Friday, September 4, 2009

SCJP Questions

1 Public class test (
2 Public static void stringReplace (String text) (
3 Text = text.replace ('j' , 'i');
4 )
6 public static void bufferReplace (StringBuffer text) (
7 text = text.append ("C")
8 )
9
10 public static void main (String args[]} (
11 String textString = new String ("java");
12 StringBuffer text BufferString = new StringBuffer ("java");
13
14 stringReplace (textString);
15 BufferReplace (textBuffer);
16
17 System.out.printLn (textString + textBuffer);
18 }
19 )
What is the output?
Answer: JAVAJAVA

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 */