Manu Kumar

Greenhorn
+ Follow
since Aug 31, 2003
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 Manu Kumar

congrats mika i am also passed scjp with 88%
18 years ago
>>> operator may be -ve example
-1>>>32
in the above case o times we shifted it so the result is remain same as 32/32 we get 0
i passed scjp1.4 88% marks
and i thanks to all of u
exam was not very easy some questions are very tough but this doesn't mean that all are tough but some are very easy. garbage collection and threads
question are tough so i advice u to practise more on gc and threads
18 years ago
as in the given below constructor it is given a compile time error
recurcive constructor invocation
public class B {
B(String s) {
this();
}
B() {
this("hai");
}
but in k&b it is given an exception
than what will do in exam either compiler error or exception
hai
my exam was on 19th but due to some problems in prometric center the exam was postponed and now i will give my exam on 24sep .
now i have 3days time i am little bit confused in inner classes pls give the details if anyone have
as it is given page 508 of k&b on 4Th line that we can not call start again on dead thread otherwise give runtime exception
but when i do this it will not give any runtime exception i know that thread is not resrated but the run time exceptio is also not there
pls reply me soon as i will give my exam tommorow
class I {
private String name;
public void finalize() {System.out.print(name);}
public I(String s) {name = s;}
}
class J {
private static void m1(I[] a1) {
a1[0] = a1[1] = a1[2] = null;
}
public static void main (String[] args) {
I[] a1 = new I[3]; // 1
a1[0] = new I("A"); // 2
a1[1] = new I("B"); // 3
a1[2] = new I("C"); // 4
m1(a1); //5
System.gc();
}
}

in this after line //5 there are three objects created at //2,3,4
objects eligible for garbage collection
while in the below question

class I {
private String name;
public String toString() {return name;}
public I(String s) {name = s;}
}
class J {
private static void m1(I[] a1) {
a1 = null;
}
public static void main (String[] args) {
I[] a1 = new I[3]; // 1
a1[0] = new I("A"); // 2
a1[1] = new I("B"); // 3
a1[2] = new I("C"); // 4
m1(a1); //5
for (int i = 0; i < a1.length; i++) {
System.out.print(a1[i]);
}
}
}
in this no object is elligible for garbage collection after //5pls explain me
which methods we have to remeber for collections of classes arraylist,
vector,hashset,hashmap...etc
as in k&b no method are given for such classes