raja pratap

Greenhorn
+ Follow
since Mar 21, 2000
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 raja pratap

Hi,
I cleared SCJP exam with 83% today.Thanks to everyone who has contributed to this site.I want to thank especially everyone for my success.
Some of the questions were the same from mock exams.I think one must be careful when writing mock exams.They should not blindly accept the answers in the mock tests.If you get doubt you must try to compile it or otherwise we have javaranch here to post and discuss.
And once again thanks for everyone.
May be by creating the instance of the subclass I guess.
But if I want to use non-abstract methods with out subclassing the abstract class,what should I do??Is this possible??
Can some one give clear explanation of this concept.
Thanks again.
This site gives the whole plan how to prepare for exam http://www.geocities.com/vamsykalyan/jcp2.htm
and you will find some more Mock exams I guess.
All the best.
I was going through RHE yesterday and I found:
A class that is abstract may not be instantiated(that is you may not call its constructor).
Now my question is.......
If we have an abstract class in which only one method is declared abstract and rest have implementation in it,then how do I call other methods with out creating an instance??
Help me out??Thanks in advance.
If we declare access modifiers for the variables in methods,does it give compile time error??
I think it does...
Is there a way that I can stop the instantiation of the class??
With respect to User and Daemon threads:
a) Daemon threads can not be destroyed
b) Running User threads prevent a JVM from terminating program
c) Running Daemon threads prevent a Java VM from terminating program
d) Daemon threads can not be grouped together
e) The JVM can terminate program when only daemon threads are running
My answer : a b e but given only b,e can anyone explain??
It is given in the javaranch roundup game,
Assume that the bit pattern of the byte x is 10110001.What will be the sign of x after x>>2?
It is given negative?How come??
I think before performing the shift operation, byte will be converted to int and then this operation will be performed.So I think the answer should be positive.And one more thing, I tried to compile it but it didn't compile because the value represented by the bit pattern above will not fit into a byte range... Help me.....
Which is an example of polymorphism.
a. inner classes.
b. anonymous classes.
c. method overloading.
d. method overriding.

I think the answer is both C and D.
Because method overloading is compile time polymorphism and method overriding is runtime polymorphism.
Its this right?? If not correct me....Maha help me ....
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 answer for this quetion should be A&C.It was given A,B,C??
In the second case I think finalize method will be called just only once when the object is garbage collected for the first time.Isn't it?? Help me....Going to take exam in few days...
I totally forgot about the bitwise operators while answering this question.So one must be careful while answering questions in the real exam.
Anyway thanks alot.
It was given first answer is also correct.But I don't think so.
Which statements about garbage collection are true?
Select all valid answers.
a)You can directly free the memory allocated by an object.
b)You can directly run the garbage collector whenever you want to.
c)The garbage collector informs your object when it is about to be garbage collected.
d)The garbage collector reclaims an object´┐Żs memory as soon as it becomes a candidate for garbage collection.
e)The garbage collector runs in low-memory situations.
It seems to me the answer is only C.Can anybody explain about other answers?
Thanks alot..........