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 pojo class in java?

1013


Explain about sets?

955


What is the default value of float and double datatype in java?

965


Mention a package that is used for linked list class in java.

911


How arrays are stored in memory in java?

944


What are the main differences between notify and notifyAll in Java?

1044


What is skeleton and stub? What is the purpose of those?

1037


Which package is always imported by default?

1051


Does collectionutils isempty check for null?

1377


What does @override mean?

1120


What about interthread communication and how it takes place in java?

1000


What is function declaration?

922


What is java used for?

979


How do you override a method?

966


What is object english?

1012