Java Professional Certification
- instanaceof Class
- Sat, 12 Jul 2008 21:22:00 GMT
- There's a question ______________________________Object type comparison instanceof - cant use java.lang.Class or its String name on RHS._____________________________The answer is True.But I think answer is False Because the code given below gives an output of 'True"class insta {public st...
- I was taking K and B master test. The expression i...
- Sat, 12 Jul 2008 18:11:00 GMT
- I was taking K and B master test. The expression if (y-- >7)...The two minus signs were merged in a way that it looked like one single minus sign.Will real exam have such a problem?ThanksBarkat...
- "" + ..how does this work?
- Sat, 12 Jul 2008 21:30:00 GMT
- What will be the output of the following lines ? System.out.println("" +5 + 6); //1 System.out.println(5 + "" +6); // 2 System.out.println(5 + 6 +""); // 3 System.out.println(5 + 6); // 4Options :1)56,56,11,112)11,56,11,113)56,56,56,114)56,56,56,565)56,56,11,56Ans :1)56,56,11,11I feel the ans is...
- """"THIS"""""
- Sat, 12 Jul 2008 18:14:00 GMT
- I am posting something for the first time. Please excuse me for my mistakes.I am confused with the use of THIS in the following context..class Light{ //Instance variables int n; //constructor public Light(int n){ this.n = n; //1. assignment to instance variable this.somemethod(); //2. somemethod...
- ""Do not use exceptions for flow control", huh?
- Sat, 12 Jul 2008 20:46:00 GMT
- Hi Kathy and Bert,With reference to the Java 2 (Sun certified programmer and developer):Chapter 4, page 212:"...Java also throws in a couple of flow control features you might not have used before - exceptions and assertions."Chapter 12, page 599:"Do not use exceptions for flow control!"These tw...
- " " doesn't work in package import
- Sat, 12 Jul 2008 14:26:00 GMT
- Here are two classes from Bruce Eckel's thinking in JAVA:The first creates a tool package for System.out.println shorthand, the second is to test the new utility tool by importing the package.//: com:bruceeckel:tools:P.java// The P.rint & P.rintln shorthand.package com.bruceeckel.tools;publi...
- "....."?
- Sun, 13 Jul 2008 10:38:00 GMT
- can someone tell me in the real test, when you are asked to fill in the blank with your answer, is it required to use double quote"..." or not? or it doesn't matter?Indy[This message has been edited by Indy (edited May 03, 2000).]...
- "..EJB must not attempt to define a class in a package"
- Tue, 15 Jul 2008 21:45:00 GMT
- One of the programming restrictions goes like this:"The enterprise bean must not attempt to define a class in a package."Maybe I'm reading it wrong but I have no clue what this means!Can anyone explain this to me, please?Many thanks,Ryan[ January 09, 2004: Message edited by: Ryan Fernandes ]...
- "? super Object" means what?
- Sat, 12 Jul 2008 14:24:00 GMT
- Q1List <? super Object> list = new ArrayList <Object> ();list.add(" "); // why this is allowed even when String is NOT Super //type of Object?list.add(new Object());Q2List <? extends Object> lst = new ArrayList <Object> ();lst.add(new Object()); // not allowed. Why?...
- "@since" or "@throws" tag of Javadoc
- Sat, 12 Jul 2008 20:12:00 GMT
- I am not clear about ".thatisjava.com.since" and ".thatisjava.com.throws" tag .First ".thatisjava.com.since" tag:Below is a sample doc comment for a class./** * Description of class * * .thatisjava.com.author xyz * .thatisjava.com.version 1.0 * .thatisjava.com.since 1.0 */Is this(above) right doc comment(only concerned tags are given) for ".thatisjava.com.since" tag ?If this class is modified, and...
- "\d" vs "\\d" while tokenizing
- Sat, 12 Jul 2008 17:57:00 GMT
- In K&B it is said that if "\d" doesn't work then try "\\d" while running the program. Though "\d" works fine in my sytem but when i tried "\\d" the o/p was different for the same program ...import java.util.*;class Tokens { public static void main(String... args) { String[] tokens = args[0]....
- "+" Operator
- Sun, 13 Jul 2008 11:09:00 GMT
- Hi everyone,Please see the following code:1) String s = "One" + 12) String s = "One" + '1'The 1) works, but the 2) will cause a compile time error. Could you please explain to me why?Thanks,Vik...
- "=" oprator question
- Sun, 13 Jul 2008 10:08:00 GMT
- Hi,Given:11. class ClassA {}12. class ClassB extends ClassA {}13. class ClassC extends ClassA {}and:21. ClassA p0 = new ClassA();22. ClassB p1 = new ClassB();23. ClassC p2 = new ClassC();24. ClassA p3 = new ClassB();25. ClassA p4 = new ClassC();Which three are valid? (Choose three.)A. p0 = p1;B....
- "==" Question from Kathy's Book
- Sun, 13 Jul 2008 11:00:00 GMT
- Given the following,import java.awt.Button;class CompareReference { public static void main (String [] args){ float f = 42.0f; float [] f1 = new float[2]; float [] f2 = new float[2]; float [] f3 = f1; long x = 42; f1[0] = 42.0f; }}which three statements are true? (Choose three)A. f1 == f2B. f1 =...
- "==" & equals()
- Sat, 12 Jul 2008 17:29:00 GMT
- Ok, I know that operator "==" compares references and equals() values, but, I know too that String is imutable, so why this code on the first example gives 'true' if the others gives 'false'?code: // -- 1 -- // String a = "a"; String b = "a"; System.out.println( a==b ); //true //...
- "==" & Number-Wrappers
- Sat, 12 Jul 2008 21:44:00 GMT
- I just don't understand what happens here:code:Integer integer1 = new Integer(5);Integer integer2 = new Integer(5);System.out.println(integer1 == integer2); //falseSystem.out.println(integer1 == 5); //trueSystem.out.println(integer2 == 5); //trueI think it's strange, that == is not trans...
- "==" in String Class & Wrapper Class
- Sun, 13 Jul 2008 09:32:00 GMT
- String s1="Priyam"; String s3="yam";String s2="Pri" + s3;System.out.println("s1==s2:: " + (s1==s2)); //Output falsebut such is not the Output in Wrapper ClassesInteger int3 = 5; Integer int5 = 2; Integer int4 = 3 + int5;System.out.println("int3==int4:: " + (int3==int4)); //Output truewhy is a di...
- "==" on Wrapper Class
- Sat, 12 Jul 2008 14:28:00 GMT
- The concept is clear that, if two Integer objects has the same value, in the range of -128 to 127, they both refer to the same object.For Example:class Wrapper{ public static void main(String[] args) { Integer i1=10; Integer i2=10; System.out.println(i1==i2);// prints true }}But please explain w...
- "a negative value of a " question required
- Sun, 13 Jul 2008 10:13:00 GMT
- Which of the following results in a negative value of a?A:byte a = -1; a = (byte)(a >>> 5);B:int a = -1; a = a >> 5;C:int a = -1; a = a >>> 32;D:int a = -1; a = a >>> 8;The answer is A,B,C.But why?Thanks!!...
- "abc"=="abc"?
- Sun, 13 Jul 2008 13:15:00 GMT
- "abc"=="abc"true or false? And why?Thanks!...
- "add" is a Standard javabean prefix or not?
- Sun, 13 Jul 2008 10:04:00 GMT
- Hai kathy Or SomeOther Buddies, I just started the preparation for SCJP 1.5 , In Kathy sierra's book ..Chapter 1 ( Access control ) , i have a conflict in a information. In Chapter they said as "add" is a valid standard javabean prefix to use in javabean methods. But in the SelfTest answers...
- "as a" & "has a" Relations
- Sat, 12 Jul 2008 18:47:00 GMT
- HICan someone please explain these relations with examples ? Any good resources on the Net ?ThanxTintin...
- "assert i%2==0 : i;"question required
- Sat, 12 Jul 2008 14:22:00 GMT
- What will happen when you attempt to compile and run the following code? (Assume that the code is compiled and run with assertions enabled.)1. public class AssertTest2. {3. public static void main(String args[])4. {5. for(int i=0;i <10;i++)6. {7. try8. {9. assert i%2==0 : i--;10. System.out.p...
- "assert" keyword?!
- Sat, 12 Jul 2008 17:51:00 GMT
- Hi,Some mock exams say "assert" is a keyword, Is it true.thanks...
- "auth-constraint" tag
- Wed, 16 Jul 2008 23:36:00 GMT
- Hi friends...How do u do?I have a doubt regagrding security...When we specify following two <auth-constraint> tags for a single web resource what happends?1)<auth-constarint/>2)<auth-constarint>*</auth-constarint>In HFSJ they r saying that nobody can access the resource w...
- "Bad Version Information"
- Wed, 16 Jul 2008 11:05:00 GMT
- Finally I built it up using CLDC 1.0 with MIDP 2.0, compiling is OK, preverify is OK, then I jared it, the book 'Learning Wireless Java' said make a manifest file as well, I don't know what do I need for a manifest file, so i ignored it, then I made a jad file, but when I run it(emul...
- "BEA certified developer - portal solutions" -Help needed
- Tue, 15 Jul 2008 17:33:00 GMT
- Hi, Im going to write "BEA certified developer -portal solutions" exam.for that im looking for a book/study material/e-doc that covers the complete syllabus. I had a look at bea's docs but it covers so many things other than required. can any body plz suggest me a specific material for this...
- "bean code" on xxvi?
- Sat, 12 Jul 2008 08:56:00 GMT
- In the middle of the second paragraph, before the 'getting tomcat' box, it says "much better off developing the bean code completely by hand." That looks like a leftover from HFEJB maybe?--Dale--[ September 17, 2004: Message edited by: Dale Seng ]...
- "Bean Things" in afterCompletion()
- Tue, 15 Jul 2008 21:33:00 GMT
- In afterCompletion() you cannot call setRollbackOnly() or getRollbackOnly(), because the transaction has completed. Also you cannot access another enterprise bean or a resource manager. Page 512 of Head First EJB says "You can't do any tranaction-related things because you're no longer i...
- "booking" question
- Sat, 12 Jul 2008 19:07:00 GMT
- Hi,ok, is my design right..1.when the user wants to book a seat, a booking dialog pops up2.the dialog shows the flight number and the amount of seats left3. if the user clicks "book" the record is locked and modified4. unlockdoes the above sound ok?My concern is, what if someone deletes the reco...
- "Java Professional Certification" Related Questions
- instanaceof Class
- There's a question ______________________________Object type comparison instanceof - cant use java.lang.Class or its String name on RHS._____________________________The answer is True.But I think answer is False Because the code given below gives an output of 'True"class insta {public st...
- "" + ..how does this work?
- What will be the output of the following lines ? System.out.println("" +5 + 6); //1 System.out.println(5 + "" +6); // 2 System.out.println(5 + 6 +""); // 3 System.out.println(5 + 6); // 4Options :1)56,56,11,112)11,56,11,113)56,56,56,114)56,56,56,565)56,56,11,56Ans :1)56,56,11,11I feel the ans is...
- "bean code" on xxvi?
- In the middle of the second paragraph, before the 'getting tomcat' box, it says "much better off developing the bean code completely by hand." That looks like a leftover from HFEJB maybe?--Dale--[ September 17, 2004: Message edited by: Dale Seng ]...
- "+" Operator
- Hi everyone,Please see the following code:1) String s = "One" + 12) String s = "One" + '1'The 1) works, but the 2) will cause a compile time error. Could you please explain to me why?Thanks,Vik...
- " " doesn't work in package import
- Here are two classes from Bruce Eckel's thinking in JAVA:The first creates a tool package for System.out.println shorthand, the second is to test the new utility tool by importing the package.//: com:bruceeckel:tools:P.java// The P.rint & P.rintln shorthand.package com.bruceeckel.tools;publi...
- "BEA certified developer - portal solutions" -Help needed
- Hi, Im going to write "BEA certified developer -portal solutions" exam.for that im looking for a book/study material/e-doc that covers the complete syllabus. I had a look at bea's docs but it covers so many things other than required. can any body plz suggest me a specific material for this...