SCJP (Sun Certified Programmer for the Java 2 Platform) tutorials: Page 3

Home arrow Java Tutorials arrow SCJP(310-035) arrow SCJP (Sun Certified Programmer for the Java 2 Platform) tutorials
SCJP (Sun Certified Programmer for the Java 2 Platform) tutorials Print E-mail
User Rating: / 32
PoorBest 
Contributed by Joe   
Friday, 07 July 2006

SCJP (Sun Certified Programmer for the Java 2 Platform) tutorials

Given:


1. public class Test {
2. public static void main (String [] args)  {
3. string foo = “blue”;
4. string bar = foo;
5. foo = “green”;
6. System.out.printIn(bar);
7.    }
8. }

What is the result?

A. An exception is thrown.
B. The code will not compile.
C. The program prints “null”
D. The program prints “blue”
E. The program prints “green”


Which code determines the int value foo closest to a double value bar?

A. Int foo = (int) Math.max(bar);
B. Int foo = (int) Math.min(bar);
C. Int foo = (int) Math.abs(bar);
D. Int foo = (int) Math.ceil(bar);
E. Int foo = (int) Math.floor(bar);
F. Int foo = (int) Math.round(bar);



Last Updated ( Monday, 17 July 2006 )

  home              contact us

 

©2006-2009 DeveloperZone.biz   All rights reserved     powered by Mambo Designed by Siteground