Zak Guesmia

Greenhorn
+ Follow
since May 28, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Zak Guesmia

Congrats to all the ranchers. hope scjd 5.0 and scea 5.0 will be released soon.

c1.m1(c2); is only coorect at RUNTIME, but at compile time the compile wont check the underlying types, i mean when compiling c1 is of type A and c2 is of type C2, unfortunately when u compile there is no correlating method to void m1(C2) in your class A.
i mean declaring parmaterized enums not using the abstract class Enum.

Plz refer to the javadoc, to see the signature of java.lang.Enum
Enum CANNOT be parameterized. What is the point of parameterizing Enums?

if all enum fields are implicitely final and static, how could you use a type parameter in a static context?
If you are familiar with java or already did take the scjp1.4, you can build on your experience and use the java Language Spec. & some available books on java tiger, like the one i actually use which is brief and concise but doesnt contain much details. (Java tiger : a develoepr's notebook)

Besides that, If you have some mock exams of scjp1.4 you can use them also but not for a long time, a period of 1-2 days is sufficient to refresh the memory.
Those questions are based on the JLS, and i have myself tested some of which, ill read this article thoroughly, but tell what goes wrong?
Q5 : b
Q8 : a,d

i ll post my explanations later. Plz refer to the generics tutorial and JLS for more details about type conversions and erasure.
Hi all beta testers,

Everybody has to contribute i cannot afford covering all the objectives by myself.
Q17 : what would be the output of this program? (Choose One)

a) one two one two
b) one one one two
c) one two one one
d) the program won't compile
e) none of the above

Q18 : what would be the output of this program? (Choose One)

a) 15 138 15 138
b) 15 138 0 0
c) 0 0 0 0
d) 0 0 15 138
e) the program won't compile

Q19: Given the following chunk of code, select two correct statement

a) the code compiles successfully
b) the would compile if you parametrize myIntList, to be "List<int[]> myIntList" in Line 2
c) the would compile if you de-parametrize floatNumbers, to be "List floatNumbers" in Line 8
d) the code would compile if you substitute "float i : floatNumbers" in Line 12 by "Float i : floatNumbers"
e) the code would compile if you substitute "Integer i : myIntList" in Line 4 by "int i : myIntList"
f) the code would compile if you substitute "Integer i : myIntList" in Line 4 by "Object i : myIntList"
g) none of the above


Q20: Given the following code, select the correct statement

a) the code compiles successfully
b) ClassCastException
c) IllegalFormatConversionException
d) the program would compile if you decalare ShowWinners as abstract
e)the code doesnt compile because asList(int...) is not defined in java.util.Arrays
f) none of the above

Q21 : Choose the correct answer.

a) The code compiles successfully.
b) the code doesnt compile bc Iterable is not part of java.util
c) the code would compile if TextFile doesnt implement Iterable
d) the code would compile if you replace BuffredReader by InputStreamReader
e) none of the above

Refer to the 16 previous questions on the thread :
---------------------------------------------------------
mock questions


( tags added)
[ January 10, 2005: Message edited by: Barry Gaunt ]
You should know the methods that are common to all classes, those that are in the java.lang.Object
clone, equals, finalize, getClass, hashCode, notify and notifyAll, toString, and the 3 wait(...)
simply use a String as a placeholder, do your job, and get back to your StringBuffer or StringBuilder if you use 1.5. StringBuilder is more efficient on most implementations than StringBuffer but it is not thread-safe
e.g.
StringBuffer buffer = new StringBuffer("HELLO");
// or StringBuilder buffer = new StringBuilder("HELLO");
String hello = buffer.toString().toLowerCase();
buffer.setLength(0);
buffer.append(hello);
Q16: what is the output of this code? (Choose one)

String[] hello = new String[]{"Hello ", "World", "! "};
System.out.printf("%s %s", hello);

a) NullPointerException
b) Hello
c) Hello Hello
d) Hello World! Hello World!
e) none of the above