karthick chinnathambi

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

Recent posts by karthick chinnathambi

Thanks a lot for the link I recommended the old link to my friend but it did not work . Now i will recommend this one
Hi Roel De Nijs ,

Thanks for the reply . That really helped . Will post again if i have any more queries .
Hi All , Sorry for posting this here .

I have completed SCJP for SE6 long back and i am planning to take up SCJD now . I haven't started my preparation yet . But it will be very helpful for me if anyone could explain me about how to approach this exam and what all i need to cover before taking this exam . Also which book can i refer which will completely cover the exam objectives. Also how many days approximately do i need to prepare .

Thanks in Advance !!
Actually that code is confidential.. That's why i didn't.... I figured out that it was because of something else.. Two other fucntions where repeatedly calling each other without any exit point.

Thanks anyway for the reply..



I am getting this Strange Error when converting a Collection to Array . I wonder why KeyIterator constructor is recursively called. Please help me if anyone has a clue about it..

Thanks in Advance !!!
If you want a class to be immutable you have to make all it's instance variables private and you shouldn't provide any setter methods that manipulate those instance variables. The classes can be made immutable by implementing it in such a way . Not by adding specifiers.
yes.... i get it... it's in developer's hands only
Hi all ,




I know that the something like above code is meaningless as the B's constructor is not synchronized (i suppose that Object class constructor is also not synchronized)
Then why didn't JAVA compiler throw error for this kind of implementation ? (Rather it throws a warning only )

i suppose that the problem is with you creating a database... Aren't you using SQliteOpenHelper ??


or else

if you wan't to actually check if a specific table is present or not just query the table for some fields (probably "_ID" field) . If the cursor is null the table doesn't exist
13 years ago


catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw e;

}



]

Why are you throwing the Exception here in the "CATCH- Block " again... That will definitely cause the program to exit. Stop throwing it .
13 years ago
Hi Ankur Shanbhag ,

Does ExamLab match real exam difficulty level or i need to prepare a lot more ?



ExamLab difficulty level is higher than that of the real Exam.

should i keep attempting more of these ExamLab test's and try to increase my scores and level ?



Keep attempting and finish all the test. This will really be helpful.

What should be the practice score so that we can confidently clear SCJP6 ?



The score which you got for the "Exam Lab - First Test" itself is a good score. You can be very confident in clearing the SCJP exam


If you closely observe your code, you are compiling class E and then trying to run class A. Thats why
its giving this issue. Another problem is, you should try to declare your class A public, rather then default
access.



This has nothing to do with the problem . Any class that is NOT public can be saved with any Name . But if you compile that JAVA file the class file generated will be of the name <defined_class_name>.class

In this case if you compile E.java you will get A.class.


Since you haven't declared any packages just put your .class file into

<your_jdk_path>/bin

folder. In command prompt go to this

<your_jdk_path>/bin

folder and
execute "java A" command . If you still have the issue , let me know.
To make it Simple...

Your Question's Equivalent one is


In the above code as far as i know "c3 is Garbage Collectible ".


only if you do...


Then C3 is NOT garbage Collectible

A thread may acquire 2 or more Locks of synchronized methods/blocks. TRUE/FALSE



This is not a proper question.

Locks are for objects and NOT FOR methods

If you are just talking about a thread acquiring one or more locks on different or distinct objects then it's TRUE.
If your question is , "A thread may acquire 2 locks on the same object" then it's FALSE . (AN OBJECT HAS ONLY ONE LOCK)


*********************************************


MyClass.class
.....
public static synchronized int getCount() {
return count;
}
public static synchronized int getCount2() {
return count;
}
.....

OR

MyClass.class
.....
public static int getCount() {
synchronized(MyClass.class) {
return count;
}
}
public static int getCount2() {
synchronized(MyClass.class) {
return count;
}
}





This will work fine . These are just two equivalent representations.


As "Stephan van Hulst" said Default Constructor existence is not a Compulsion for any Class.
But
If you don't have a Don't have a default Constructor in the Super class and you forget to insert a super(<with appropriate parameters>) inside every subclass you create then the compiler will Complain .

The following code will result in a Compiler Error :

"Implicit super Constructor A() undefined will be the error"