Friday, September 4, 2009

SCJP Questions

Given:
1 //point X
2 public class foo (
3 public static void main (String[]args) throws Exception {
4 printWriter out = new PrintWriter (new
5 java.io.outputStreamWriter (System.out), true;
6 out.printIn("Hello");
7 }
8 )
Which statement at PointX on line 1 allows this code to compile and run?
A. Import java.io.PrintWriter;
B. Include java.io.PrintWriter;
C. Import java.io.OutputStreamWriter;
D. Include java.io.OutputStreamWriter;
E. No statement is needed.
Answer: A

0 comments:

Post a Comment

 

About

Site Info

Information Source

Academy of JAVA by Rajesh Rolen Copyright © 2009 Community is Developed by Rajesh Kumar Rolen WebSite

/* tracking code by yahoo login */