Solution to the program http://javacoderblog.blogspot.com/2010/05/tricky-program-1-to-java-beginners.html
import java.io.*;
public class NMM
{
static
{
final PrintStream out = System.out;
PrintStream newOut = new PrintStream(out)
{
public void println(String str1)
{
print("Great ");
print(str1);
super.println("Programmer");
}
};
System.setOut(newOut);
}
public static void main(String [ ]argums)
{
System.out.println("Java ");
}
}
No comments:
Post a Comment