Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What happens if we don’t override run method ?

1003


What is a numeric literal?

1072


Can final class have constructor?

920


Can we override protected method in java?

1061


What is the latest version of java?

1127


Are arrays dynamic in java?

1031


What is identifier give example?

1027


Give me an example of array and linked list? Where they can be used?

1005


Is string serializable in java?

1014


How do I compare two strings in word in java?

991


Java is Pass by Value or Pass by Reference?

1041


Can you create an object of an abstract class?

1017


What is the biggest integer?

1050


What is string :: npos?

1078


What should I import for arraylist in java?

1034