posted 24 years ago
I would like a few clarifications on the following mock questions
Select valid arrays declarations or initializations (Select 3)
a) int a[] = new int[5];
b) Double d = new double[4];
c) Char []c = "Element";
d) Object obj = new double [8];
e) int ab[][] = {0,1,2} {1,5,6}
f) int []q = {1,2,3}
Now I didn't think there was three valid since a, f and I think b,c,d are in the wrong form and that leaves f but there is no semi colon on the end of the line and also there is no comma separating the two array groups. Are these things not needed for some reason?
2) What can the throw statement throw? (select 4)
a) Error
b) Event
c) RunTimeException
d) Object
e) Exception
f) Throwable
Now here I am thinking a, c, e, and f since these are all derivations of error handling.
[Third question deleted because it turns out to be extremetly similar to a real exam question (though Ian didn't know that) - Jim Yingst]
Thanks,
Ian
[This message has been edited by Jim Yingst (edited March 31, 2001).]