KN

Ranch Hand
+ Follow
since Aug 13, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by KN

Hi Brian,
There's no need to be depressed by your performance in Khalid's mock exam. It's a really good book to clear the fundamentals but it's exam is tougher than others. I also scored very well in Marcus exams & many other exams but performed poorly in Khalid's exam. But even then I scored 93% in SCJP. In my personal opinion, Marcus exam is closest to the real exam. Real exam is simple & it tests you on the fundamentals & doesn't try to trick you. So, go through all the mock exams, work on your fundamentals & you will come through.
All the best!
Kiran.
Frank,
It's not clear from your Question what exactly you are asking. RHE is the name of the Book- The complete certification Guide for Java2 Programmer by Simon Roberts(R), Phillip Heller(H) & Michael Earnest(E).
Hope this helps.
Kiran.

CONGRATULATIONS!
Well Done!
Kiran
Hi,
A class can be converted into an interface if that class or any of its superclasses implements that interface. In this case, superclass of ApDerived(i.e, ApBase) implements Runnable. So ApDerived can be converted to Runnable. So, Both A & B are correct.
Hope this helps.
Kiran.

CONGRATULATIONS Srinivkk!
I don't think that the score is reflected on the certificate. And regardless of the score, being SCJP has its own value.
Kiran.
CONGRATULATIONS!!! Good job!
Kiran.
Thanks Rahul, All my doubts are cleared now.
Kiran
Thanks Bill. First of all, I would like to say that you have written an excellent book. It's really helpful while preparing for SCJP.
I agree with your statement. It will compile fine. But the Question asked if it will compile & execute without errors. A check will be made at runtime to see if Object implements Runnable.It should throw an Exception as Object doesn't implement Runnable(am I right here!). But to my surprise it works fine. Can you please explain me why?
Regards,
Kiran.
Hi Everybody,
Can someone help me regarding these questions.
Question1:
Which of these statements are true?
A) Running user threads prevent JVM from terminating a program.
B) Daemon threads can't be grouped together.
C) Daemon threads can't be destroyed.
D) Running Daemon threads prevent JVM from terminating a program.
I am sure that A and C correct but i want to know if B is also correct.
Question2:
Which of the following condition will cause the thread to stop?
A) sleep (long ms)
B) wait ()
C) notify ()
D) suspend ()
E) stop ()
F) run method ends
I think Answers are E and F. If the question is - Which of these will cause the thread to stop executing. The answer will be A, B, D, E and F. Please tell me if I am correct!
Thanks
Kiran.
Vasansrini,
You are right, it was a typo. I have corrected it.
class ApBase extends Object implements Runnable
ApBase aBase = new ApBase();
I think it means that the class ApBase extends class Object & class ApBase implements Runnable. It doesn't mean that Object class implements Runnable. Correct me if I am wrong.
If you think that it means that Object implements Runnable then option A should also compile fine.
Thanks,
Kiran.
CONGRATULATIONS!!! Well Done!
Best wishes for Future!
Kiran.
Hi Everybody,
Can anybody help me regarding this question!
Suppose we have two classes defined as follows:
class ApBase extends Object implements Runnable
class ApDrived extends ApBase implements Observer
Given two variable created as follows;
ApBase aBase = new ApBase();
ApDerived aDer = new ApDerived();
Which of these will compile and execute without errors
A) Object obj = aBase;
Runnable rn = obj;
B) Object obj = aBase;
Runnable rn = (Runnable) obj ;
C) Object obj = aBase;
Observer ob = (Observer)aBase;
D) Object obj = aDer;
Observer ob2 = obj;
The answer given is B, but I think none of them is correct. A class can be converted into an interface only if that class or any of its superclasses implement that interface. Then how can B be correct. Can anybody explain me.
Regards
Kiran.

[This message has been edited by KN (edited August 13, 2000).]
Hi Jim,
I agree with you. If you don't specify the return statement with the suitable return type, it won't compile. But if this type of Question comes in the exam, how can we be sure that it's not asking us to test for the suitable modifiers, position of the return type etc. If we are asked to choose the legal method definitions, should we not pick this one?.
public int aMethod(int a){}
Can you please clear my doubt regarding this.
Regards,
Kiran.
24 years ago
Thanks Ajith. Actually there was a Question in Sun Certified Java Programmer Book & it says that this is illegal. That left me in doubt.
Regards,
Kiran.
Hello everybody,
I want to know if it's legal to use abstract modifier with interface definition. i.e
abstract interface E{}
I know that interface is implicitly abstract & it is better not to use abstract modifier explictly but if we use it then it compiles fine. So if the question is whether it is legal or not what should be the answer.
Regards
Kiran.