Puja S

Ranch Hand
+ Follow
since Jan 06, 2005
Merit badge: grant badges
For More
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 Puja S

Thanks to all the people in javaranch......this site really helped to get such scores.
I prepared from Khalid aswell as Kathy and Bert's book.Did as many mock exams as I could. Dan's as well as Marcus links were the best of all. Got all my queries solved from the talanted people in this site.......my personal thanks to all of them.
Although I had a bit of programming background,it took 4 months for the preparation.Now I'll move on to give the SCWCD exam.

Thanks!!!
19 years ago
Hi,

I want to ask ,if wait(),notify() and notifyAll() methods are not invoked form a syncronized code or block,will it give an exception at runtime(Runtime Time Exception) ?

Thanks
Thanks Mike........I understood the concept.
Thanks Mike,
You said "You must use a reference of your class or a subclass of your class to access the protected member".......I am not able to understand how a subclass of the class can be used.Please can you give me an example.

Thanks
Hi,

package testpkg.p1;
public class ParentUtil {
public int x = 420;
protected int doStuff() { return x; }
}

package testpkg.p2;
import testpkg.p1.ParentUtil;
public class ChildUtil extends ParentUtil {
public static void main(String [] args) {
new ChildUtil().callStuff();
}
void callStuff() {
System.out.print("this " + this.doStuff() );
ParentUtil p = new ParentUtil();
System.out.print(" parent " + p.doStuff() );
}
}

which statement is true?

1. The code compiles and runs, with output this 420 parent 420.

2.If line 8 is removed, the code will compile and run.

3.If line 10 is removed, the code will compile and run.

4.Both lines 8 and 10 must be removed for the code to compile.

5.An exception is thrown at runtime.


The answer ios 3....Why? Can anybody explain me. I thought the answer was 1.

Thanks.
Hi,

Can anybody explain me my doubt in a simple way
Hi,

Can anybody explain me this code.....

The answer is 1,3,2

I am not able to figure out how ???

Thanks

( tags added and hopefully reformatted more clearly)
[ January 22, 2005: Message edited by: Barry Gaunt ]
a million thanks to you marc......it is now clear to me.
It was that I was not going on the right track......but now it looks very simple......I'll try some more questions on the same.

Hi,

Is it mentioned in the real exam,the number of correct options ?


Thanks.
Hi,

I'm finding difficulty in solving the following question.These type of questions are taking a lot of time and if they come in the exam i'll be

Please can anybody give me a simple way solve them.

class EBH019 {
public static void main (String args[]) {
int i1 = 0xffffffff, i2 = i1 << 1;
int i3 = i1 >> 1, i4 = i1 >>> 1;
System.out.print(Integer.toHexString(i2) + ",");
System.out.print(Integer.toHexString(i3) + ",");
System.out.print(Integer.toHexString(i4));
}}

What is the result of attempting to compile and run the program?

a. Prints: ffffffff,ffffffff,ffffffff
b. Prints: ffffffff,ffffffff,7fffffff
c. Prints: ffffffff,7fffffff,ffffffff
d. Prints: ffffffff,7ffffffe,7ffffffe
e. Prints: fffffffe,ffffffff,ffffffff
f. Prints: fffffffe,ffffffff,7fffffff
g. Prints: fffffffe,7fffffff,ffffffff
h. Prints: fffffffe,7fffffff,7fffffff
i. Run-time error
j. Compile-time error
k. None of the above


The answer is f.

Thanks
Thanks Jay for the link.
Thanks Anand.....It's clear to me now.