First I am new here, and I hope to enjoy the company of others and learn a lot and help when I can.
Now on with the questions, this are part of the certification exam which hard to admit I failed, so I am trying to see where are my mistakes and correct them.
First scope
public static void main(
String ... args){
ClassA a = new ClassA();
a = null;
class ClassA{
ClassA(){
ClassB b = new ClassB();}
ClassB(){
ClassC c = new ClassC();}
ClassC(){}
When I set a = null; how many objects are eligable for the GC?
Next question
A [] testa = new A[4];
Integer [] inta = new Integer[4];
testa = (A) inta;
While I know a invalid cast its detected at runtime, when you cast a array to a array its detected during compiler time, can someone enligh me on the reasons for this. And sorry if I post on the wrong forum.