CERTIFICATION WATCH

Get the latest certification news by email!

*





*




Our Other Sites

GoExam: Certification practice tests with free demos to download.

GoTraining: Get Training on what you need.

CertificationBooks: Find the certification book you're looking for.

Free Tech Pubs: Free computer industry magazines, newsletters, and whitepapers.

SearchCertify: links, links and more certification links!


HOT SPOTS

Sun Certified Programmer for the Java 2 Platform Quiz #1

Question 8:

What results from the following code?

1. class MyClass
2. {
3.   void myMethod(int i) {System.out.println("int version");}
4.   void myMethod(String s) {System.out.println("String version");}
5.   public static void main(String args[])
6.   {
7.       MyClass obj = new MyClass();
8.       char ch = 'c';
9.       obj.myMethod(ch);
10.  }
11. }
A. Line 4 will not compile as void methods can't be overridden.
B. An exception at line 9.
C. Line 9 will not compile as there is no version of myMethod which takes a char as argument.
D. The code compiles and produces output: int version.
E. The code compiles and produces output: String version.

 

 
Follow GoCertify on Twitter