scjp

Understanding wait()

I created this silly program to play with wait() public class WaitTest { public static void main(String [] args) { System.out.print("1 "); synchronized(args){ System.out.print("2 "); try { args.wait(); args.notifyAll(); } catch(InterruptedException e){ System.out.pri...

Question from SCJP test

Hi! Question from SCJP test: class A{ A aob; public static void main(String args[]){ A a=new A(); A b=new A(); A c=new A(); a.aob=b; b.aob=a; c.aob=a.aob; A d=new A().aob=new A(); c=b; c.aob=null; System.gc(); ...

Java inherited method question

While studying for the SCJP 6 exam, I ran into this question in a test exam: class A{ private static String staticProperty = " a "; String getStaticProperty() { return staticProperty; } } class B extends A { private static String staticProperty = " b "; public static void main(String[] args){ new ...

Java polymorphism question

For SCJP most of the time question such as below is asked to find valid example of polymorphic method calls. But what should one exactly look for to find is it polymorphic use or not ? abstract class A { abstract void a1(); void a2() { } } class B extends A { void a1() { } void a2() { } } class C extends B { void ...

Are there any goodies for SCJP?

Hi All, Just want to know whether SUN is providing any goodies (either free or paid), which can be availed for SCJPs ?? I heard like Microsoft is providing such goodies. Anybody has any idea on this? Cheers, PK ...

Is the SCJP CX-310-065 exam divided into the objectives (sections) as outlined on Sun's site?

The objectives and sections are listed here: http://www.sun.com/training/catalog/courses/CX-310-065.xml I've been using the Sun Certified Programmer for Java 6 Study Guide, which lists objectives as well that are close to those on the Web site, but they also have "sub-objectives" in the book that appear to be somewhat manufactured. Wil...

Sun training for Sun Certified Java Programmer (SCJP) - classroom or web-based?

Does anybody has any experience with Sun training? I wonder if the extra $1000 is justified if I sign up for the classroom training vs. the web-based or cd-rom one? Any advantages / disadvantages for both trainings? -Goe ...

Is SCJP still there?

I want to take the SCJP. But now Oracle has taken over Sun. So is SCJP stopped? Or it is continuing? ...

Bitwise shift operators. Signed and unsigned.

I'm practising for the SCJP exam using cram notes from the internet. According to my notes the ">>" operator is supposed to be signed right shift, with the sign bit being brought in from the left. While the left shift operator "<<" is supposed to preserve the sign bit. Playing around however, I'm able to shift the sign with the "<<" o...

SCJP question: Java method overloading with var-args. What is the rationale?

Why does the following program throw an exception? public class MainClass{ public static void main(String[] argv){ callMethod(2); } public static void callMethod(Integer... i){ System.out.println("Wrapper"); } public static void callMethod(int... i){ System.out.println("Primitive"); } } The method cal...

SCJP - exam question

It's actually from SCJP 6 StudyGuide Exam310-065(MGH,2008) The call to super() in Kinder class constructor seems to be redundant because of: quote from the book: i.e. that there is no need to type super() explicitly, as this can be done by compiler the compiler accepts very well version without call to super() The question i...

Getting confused in with == and = in "if" statement

I know that we cant use assignment operator in if statements in java as we use in any other few languages. that is int a; if(a = 1) { } will give a compilation error. but the following code works fine, how? boolean b; if(b = true) { } EDIT : Is this the exception to rule that a...

SCJP question: Method ambiguous

Take a look at this code: public class Test { public static void main(String... args) { flipFlop("hello", new Integer(4), 2004); // flipFlop("hello", 10, 2004); // this works! } private static void flipFlop(String str, int i, Integer iRef) { System.out.println(str + " (String, int, Integer)"); } private static void flipFlo...

scjp certification future validity

Is this the right time to go for a scjp certification?With Oracle being the authority won't SCJP lose its value as and when OCJP gets announced instead of the former? my worry is will one be able to go for the next level like SCWCD, once the change is brought about by oracle? ...

A Project idea which fits with Sun Certified Java Programmer (SCJP) preparation?

I'm currently preparing for the SCJP, which I plan to take in 6 months time. I was wondering weather you could give me any Java Project Ideas which ONLY involves Java (NOT JEE), which includes manipulating Object or includes certain concepts which'd appear in the SCJP Exam, to further strengthen my understanding of basic Java. Better be...

SCJP Book, IO section: Is this a typo or is there a reason it would look like this?

My question is about line (edit: 19), where the new PrintWriter is created with the constructor taking the FileWriter fw as a parameter. I don't understand the use of chaining the BufferedWriter bw to FileWriter if it isn't used later on in the actual writing. Can Java apply chaining in a way that bw still somehow affects the rest of the...

Selecting between SCJP 5 / SCJP 6

I want to take an SCJP exam, but I am unable to decide which one should I take - SCJP 5(Java 1.5) or SCJP 6(Java 1.6). It would be great if anyone could help me in this regard. Thanks, Rakesh. ...

Question concerning SCJP-6 exam

While preparing for the SCJP-6 exam I faced with a difficult issue. I can’t find answer by myself. Please, answer for the question and give short comments: abstract class A<K extends Number> { // insert code here } public abstract <K> A<? extends Number> useMe(A<? super K> k); public abstract <K> A<? super Number> useMe(A<? ex...

JVM specification and Java compiler code useful for SCJP preparation ?

I'm preparing the SCJP exam with the almost official study book ("SCJP Sun Certified Programmer for Java 6 Exam 310-065") I understand that Java programming is writting code that fulfills a certain high-level contract; So that Java can stay platform-independent. However, I have trouble understanding and remembering things when it comes...

Resources and techniques/methods for SCJP preparation ?

I am passing the SCJP 6 exam in a month. I have the "SCJP Sun Certified Programmer for Java 6 Exam 310-065" book. It seems great for the exam. But I want your advice on this. Getting the closest possible to 100% would be great. I have found a site that answered some of the questions you ask yourself when you go trough the book. Here is ...