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

Which container method is used to cause a container to be laid out and redisplayed in java programming?

1171


What is the difference between an object-oriented programming language and object-based programming language?

1055


what is the final keyword denotes in java?

1158


What type of variable is gender?

1041


What is the difference between a break statement and a continue statement?

1085


What do you mean by an object in java?

1184


What is the purpose of skeleton and stub?

1351


What is your platform’s default character encoding?

1134


How do you escape sequences in java?

1114


How to create an interface?

1129


What is the use of hashmap in java?

1134


What do you mean by access modifier?

1108


Differentiate storage classes on the basis of their scope?

1230


What are packages in java?

1791


What is bifunction in java?

1268