Asma Zafar

Ranch Hand
+ Follow
since May 11, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Asma Zafar

Yes, Marilyn castinmg does solve the CE problem.
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
Object objArray3 = {null,null}; // error
In this line you intend to declare and initialize array at the same time. But you have not specified that objArray3 is a variable of type array.
Object objArray4 = new Test[2];
At this line there is no compiler error, becuase an array can be converted to a class, if the class is an Object. But if you try to access objArray4[0] etc it will be a compiler error.
Hope this helps,
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
[This message has been edited by Asma Zafar (edited September 19, 2001).]
You have created only one button and adding it 3 times. Of course only one button will appear.

------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
RHE is a very good book. If you purchase one book for SCJP, this the book, one should buy.

------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
[This message has been edited by Asma Zafar (edited September 19, 2001).]
Congratulations. Best wishes for the future!
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
22 years ago
The correct answer is 'c'.
When you use write method on an output stream, it always writes the low order byte if the integer, in this case 0x67.
Hope this helps,
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
Congratulation !!!
Best of luck.

------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
22 years ago
The correct answer is D.
Because AWT does'nt guarantee the look of the components on various platforms.
Hope this helps,

------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
Yes, Correct answers are C and D.
sleep(10000) w/o a try/catch block is a compiler error. Because sleep() throws InterruptedException which is a checked exception and it has to be caught in the code.

------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
supplement means enhance the functionality.
e.g. you have the following methods:

public void print(String s){
System.out.prinln(s);
}
public void print(int i){
System.out.prinln(i);
}
public void print(float f){
System.out.prinln(f);
}
These 3 methods are all printing, but in each method they are printing a different thing. Basically in overlaoding the method name is the same, but parameter list is different.
Hope this helps,

------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
io
Hi,
If you go and have a look at API documentation for PrintStream, you'll find that it implements all the the print methods for various primitive types. So it need not implement DataOutput interface to print the primitive data types.
Hope this helps,

------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
[This message has been edited by Asma Zafar (edited September 15, 2001).]
Tom, the exam is never the same.
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
22 years ago
The reason why you obtain a different o/p for diffrent print calls is:
not all classes override the toString() method. To have a meaningful o/p of a class thru print, you've got to oevrride the toString() method and hence its always a good practice to define a toString() method in your classes.
Hope this helps,
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
The code compiles and runs just fine even if the commented line is uncommented.
Its output is as expected. Static methods are called according to the reference type. If no qaulifier (class or object name) is used, its called from the class where its being invoked, if the same signature method is not in the invoking class it goes up the hierarchy to find one, which is the case in your quoted example.
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
Congrats Tamanna!
------------------
Asma Zafar,
Sun Certified Programmer for Java2 Platform
22 years ago