explain System.out.println
Answer Posted / himanshu
//a program to understand how System.out.println works
class Temp{//here "class Temp{"=>"class System{"
static Demo d;//here "static Demo d"=>"static PrintStream out"
static{
d=new Demo();//here "d=new Demo()"=>"out=new PrintStream()"
}
}
class Demo{//here "class Demo{"=>"class PrintStream{"
void show(){//here "show(){"=>"println(){"
System.out.println("Hello");
}
}
class Xyz{
public static void main(String a[]){
Temp.d.show();
}
}
/*-------------------
OUTPUT
---------------------
Hello
*/
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What happens if we don’t override run method ?
What is a numeric literal?
Can final class have constructor?
Can we override protected method in java?
What is the latest version of java?
Are arrays dynamic in java?
What is identifier give example?
Give me an example of array and linked list? Where they can be used?
Is string serializable in java?
How do I compare two strings in word in java?
Java is Pass by Value or Pass by Reference?
Can you create an object of an abstract class?
What is the biggest integer?
What is string :: npos?
What should I import for arraylist in java?