Win a copy of Rust Web Development this week in the Other Languages forum!

Ann Sebastian

Ranch Hand
+ Follow
since Sep 21, 2005
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 Ann Sebastian

I passed SCJP Exam on Dec 19..
I cannot register online to www.certmanager.net/sun
How can I get SCJP logo..
Can one use it in the resume?
Please provide answers
16 years ago
Take a second glance through K&B Feel resonably comfortable with it
Take Marcus Green Mock Exams
Take Dan Chisolm Mock Exams -If u have time to spare,If not take tests on the areas u are weak
Practice K&B Master Exam
Be cool and go off to test..
U should be able to crack it with no dfficulty


Good Luck
Hi,
I just gave exam today even I was in the same boat as you trying to cram all method signatures of Collection interface last moment.Given the exam I feel that was unnecessary..The main focus is on the functionality..For ex,u should hnow SortedMap is sorted..Set has unique elements..

In case u r scared to leave it off ,just give a read through unsderstanding the functionalities than the method signatures..
Hope this helps

Ann
This morning I cleared SCJP ..
Thanks to all the ranchers who helped me out..

The main focus should be on K&B Book..

Threads and Garbage Collection require a little more Focus..
A litte focus on various situations of code not reachable compilation error

Thanks once again to all the ranchers
16 years ago
Consider the below code snippet
It prints 1
But if f() is not private then it invokes the method in PolyC and prints 2
Since PolyC does not have g() method the inherited method from PolyB is invoked.Now it has to resolve the call to f().
My doubt is since it will call this.f() why is not calling f() method in polyC than private f() method in PolyB...I am confused ..Is it some thing to do with executing within the context



public class test {
public static void main(String args[]) {
PolyA ref1 = new PolyC();
PolyB ref2 = (PolyB)ref1;

System.out.println(ref2.g()); // This prints 1
// If f() is not private in PolyB, then prints 2
}
}

class PolyA {
private int f() { return 0; }
public int g() { return f(); }
}

class PolyB extends PolyA {
private int f() { return 1; }
public int g() { return f(); }
}

class PolyC extends PolyB {

public int f() { return 2; }
}
I downloaded Khalid Mughal Exam and took the test.I could just get the final score no answers or where I went wrong...Is there any way to get the answers?


By Scoring 75% in this, will I be able to score a decent percentage in SCJP which is knocking at my doors....
Thanks
class A13 {}
class A14 {
public static void main(String[] arg) {
A13[] a1 = new A13[1]; // 1
A13[][] a2 = new A13[2][1]; // 2
A13[][][] a3 = new A13[3][3][3]; // 3
System.out.print(a3[2][2][2]); // 4
a1[0] = new A13(); // 5
a2[0] = a2[1] = a1; // 6
a3[0] = a3[1] = a3[2] = a2; // 7
System.out.print(a3[2][2][2]); // 8
}}

Line 3 outputs null which is fine,because arrays declared within the method are initialised to null..

Could any body tell me why line number 8 throws up null pointer exception?
class A {
A() {System.out.print("CA ");}
static {System.out.print("SA ");}
}
class B extends A {
B() {System.out.print("CB ");}
static {System.out.print("SB ");}
public static void main (String[] args) {B b = new B();}
}
What is the result of attempting to compile and run the above program?
a. Prints: SA CA SB CB
b. Prints: SA SB CA CB
c. Prints: SB SA CA CB
d. Prints: SB CB SA CA
e. Runtime Exception
f. Compiler Error
g. None of the above

Answer given is b..
I am infering Static initializer block of a class gets invoked before the
constructor.Could anybody clarify on this..

When is non static initialiser block invoked?
Here is the explanation given


In all three cases, the object passed to method m1 is an instance of class C; however, the type of the reference is different for each method. Since fields are accessed based on the type of the reference, the value printed by each method is different even though the same instance is used for each method invocation.



Could any body help me out with this??
Answer :ABC
Could any body give an example in which
1.instance of operator throws compilation error
2.instance of operator returns false
When do instance of operator throw up compilattion error and when it evaluates to false?
I have the CD of K&B Master Exam.How do I access the second exam provided by them.(I guess there is one)..
Could any body help me out please

PS.I am from India
I got the Second Question..
Ans is a,b and c and I agree to that..

For the first quetstion the given ans is 1.
Which object is eligible for GC
Here are exam qns from MindQ

1. How many objects are eligible for garbage collection once execution has reached the line labeled Line A?

String name;
String newName = "Nick";
newName = "Jason";
name = "Frieda";

String newestName = name;

name = null;
//Line A

a) 0
b) 1
c) 2
d) 3
e) 4


2. Which of the following statements about Java's garbage collection are true?

a) The garbage collector can be invoked explicitly using a Runtime object.
b) The finalize method is always called before an object is garbage collected.
c) Any class that includes a finalize method should invoke its superclass' finalize method.
d) Garbage collection behavior is very predictable.

I think the answers are
1.a (0) String literal pool will be referring to all objects
2.b finalise method has to be called atleast once ..

Both were given as wrong...

Could somebody explain this