All about Java certifications.
SCJP
__Sun Certified Java Professional__%%%
In this page you will resources for the SCJP certificate.
Now you can take the exam SCJP 1.4 and SCJP 5 (cx-310-055).
!!Tiger SCJP Resources
*[Sun Certified Java Programmer(SCJP 5.0)| http://www.javabeat.net/javabeat/scjp5/index.php]
*[SCJP Tutorial| http://www.javabeat.net/javabeat/downloads/scjp/books/SCJP%205.0%20Tutorials%20by%20Boot.zip]
*[SCJP Tiger Study Guide|http://www.java.boot.by/scjp-tiger/]
*[Using Static Imports for Constants and Methods| http://java.sun.com/developer/JDCTechTips/2004/tt1005.html]
*[Java Language Specification |http://java.sun.com/docs/books/jls/]
*[11 medium-hard mock exam question|http://www.wickedlysmart.com/SCJPStudyGuide/Java_5_SCJPquestions.html]
*[Cracking the New Sun Certified Programmer for Java 2 Platform 1.5 Exam by Khalid Mughal|http://www3.java.no/JavaZone/2005/presentasjoner/KhalidMughal/Khalid_Mughal-guide_to_java_cert_javazone2005.pdf]
*[scjp questions & answers by roseanne zhang|http://bobcat.webappcabaret.net/javachina/faq/01.htm]
SCJP Notes
1. The __try__ statement may not have a __catch__ block! Really? Yes, becayse it can have only __finally__ block.
try this code, it is working fine":
try{
int x = 10/0;
}
finally{
System.out.println("It will compile fine");
}
2. An empty __.java__ source code file would compile successfully. It just won't produce a __.class__ file.
SCJP Questions Discussion
If you have any question in SCJP and you want to discuss to know the correct answer post it here.
I found a question in Testking which i think the provided answer is wrong. Here is the questions:
* Question 1
package test1;
public class Test1 {
static int x = 42;
}
package test2;
public class Test2 extends test1.Test1 {
public static void main(String[] args) {
System.out.println("x =" + x);
}
}
What is the result?%%%
A. x = 0%%%
B. x = 42%%%
C. Compilation fails because of an error in line 2 of class Test2.%%%
D. Compilation fails because of an error in line 3 of class Test1.%%%
E. Compilation fails because of an error in line 4 of class Test2.%%%
__Answer: C__
Do you think this answer is true?
In my opinion this answer is not true. The correct answer is E. The test2 Class wont be able to access the member variable x in the parent class because the x access modifier is default "which is packege" so you can't access it from outside the packe even if though the subclass.
Changing x to private will solve the problem.
* Question 2
Another wrong answer in the TestKing thing.
public class Test{
public static String output = "";
public static void foo(int i)
{
try
{
if(i == 1)
{
throw new Exception();
}
output += "1";
}
catch (Exception e) {
output += "2";
}
finally{
output +="3";
}
output += "4";
}
public static void main(String[] args) {
foo(0);
foo(1);
System.out.println(output);
}
}
What is the value of the variable output at line 23 "which is foo(1) call"
Answer: 13423
This answer is wrong, the correct answer is 134234.
May be it is an error in the printing :)
*Question 3
class X
{
public static void main(String[] args) {
try {
badMethod();
System.out.println("a");
} catch (Exception e) {
System.out.println("b");
}
finally
{
System.out.println("c");
}
System.out.println("d");
}
public static void badMethod()
{
throw new Error();
}
}
What is the result:
A. ABCD
B. Compilation fails
C. C is printed before exiting with an error message
D. BC is printed before exiting with an error message
E. BCD is printed before exiting with an error message
The Answer in TestKing is B which is wrong
The correct answer is C