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 ?



printstream class method println() is calling using System class and its static object out .how it ..

Answer / 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

More Core Java Interview Questions

Explain about vector, dictionary,hash table, property classes?

1 Answers   Patni,


What is the purpose of static methods and static variables?

0 Answers  


Why is it important to initialize a variable?

0 Answers  


Is alive and join method in java?

0 Answers  


what is different between static and non static methods ,using example

2 Answers  


How can be define MARKER interfce in java

1 Answers  


what is request dispatcher and how does it work?

2 Answers   CTS,


what is marker interface ? what is the necessity of it?

5 Answers   Accenture, Newgen,


How we can skip finally block of exception even if some exception occurs in the exception block in java?

0 Answers  


What is difference between calling start() and run() method of thread?

0 Answers  


What do you mean Abstraction in java?

0 Answers   Aspire, Infogain,


Difference between comparator and comparable in java?

0 Answers  


Categories