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...

printstream class method println() is calling using System
class and its static object out .how it is explain any one
in detail with example ?

Answer Posted / chandan kumar

import java.io.*;
class Other
{
public static PrintStream wise;
static
{
try{
wise=new PrintStream(new FileOutputStream("abc.txt"));
}
catch(Exception e)
{

}
}

}
public class AB
{
public static void main(String arg[])
{
Other.wise.println("hi");
}
}
This will print hi on a file abc.txt
some thing like this is written in class System. A static
object out of PrintStream Class is defined in static block
and connected to a Stream Connected to Console.So everythin
that we write with in print()method comes out as output

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is break and continue statement?

1029


What about anonymous inner classes in java?

978


How do you bind variables?

1028


what is anonymous class in java?

981


What do you mean by an object in java?

1080


How is the marker interface used in Java?

1038


If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?

1206


Is java pass by value or pass by reference?

930


How do you define a method?

926


Why pointers are not used in java?

1053


What is double word?

923


What do you know about the garbage collector in java?

1038


What is the default access specifier for variables and methods of a class?

1138


What is nan in java?

945


Can singleton class be serialized?

909