in the getweight(mineral m) method,mineral m
in the getweight(mineral m) method,
how can a object refer to reference here!!! it is illegal argument
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
so in the program if you see...o is type casted to type casted to mineral class first!!! and then it is passed as an argument in getweight((mineral)o) method in main method..... which is refered by the method in class miner which extends mineral!!!
which is public static void getweight(mineral m) ....
So my question now is that how can new mineral(); passed as an argument in main method .....will refer to the miner class getweight method which has getweight(0 method which takes an reference variable as an argument..... isnt it illegal argument error!!
which is refered by the method in class miner which extends mineral!!!
how can reference of the class and object of the class can we meaningfully same!!