What is System.out.println ?

Can anyone reconfirm me about System.out.println,
I think this way : System is a Huge class which is the most super class to any object in the Java World. Out is a static Nested Class and println is a method. I came accross something called " PrintStream class" What is this ? Where is it located ?
Thanks in Advance..

sagararya wrote:
Nope. It's a public static field that refers to an instance of PrintStream. Best not to just try and make up definitions of things, really
====================================================================================
Public Static field... ok.... How can an instance become static ? Static field is not tagged to any object
you mean to say like this :
Class PrintStream { }
Class Something {
public static void main(String [] args)
PrintStream out = new PrintStream();
// How is the out static here ???Come on now really.
You don't have a clue on any basics, so best to stop throwing terms around in the hope that you might generate some meaningful phrases. Or if you are going to do that at least have the common courtesy to add a healthy dollop of buzzwords (the chef recommends WSDL, dynamically, DAO, Singleton and IPv6) so that we'll know the level of management doublespeak we should be using to address your posts.
If you ever feel like resolving your underlying issue do feel free to check out the link posted in reply #1. In fact here it is again for, presumably, your amusement but perhaps with luck your education as well [http://java.sun.com/docs/books/tutorial/java/index.html]

Similar Messages

  • What does System.out.println("Hello world!");  when System.console()=null?

    Hello,
    the code below:
    if(System.console()!=null)
                outStream=System.out;
            else
                outStream=new PrintStream(new FileOutputStream(new File("BasicCardReaderManagerLog.log")));
            outStream.println(System.currentTimeMillis());
            outStream.println(System.out.toString());produce the following output, in the BasicCardReaderManagerLog.log file:
    1249991451796
    java.io.PrintStream@190d11
    So it looks like System.out is valid and usable, however, since the application as no console, where I can see the output ???
    Precision: I get this situation in the main function of a console application which I launch using Process.Start. Is there any way to get a console by this mean ?
    Best regards,
    Sebastien

    Based on [http://forums.sun.com/thread.jspa?messageID=10790600#10790600|http://forums.sun.com/thread.jspa?messageID=10790600#10790600]
    import java.util.*;
    public class Java {
         public static void main(String[] arg) throws Exception {
              String[] cmd = { "cmd.exe", "/C", "start", "java.exe" };
              List<String> l = new ArrayList<String>(Arrays.asList(cmd));
              l.addAll(Arrays.asList(arg));
              cmd = l.toArray(cmd);
              Process p = Runtime.getRuntime().exec(cmd);
    }

  • System.out.println means

    Can any one explain what is "system.out.println"
    i need to know each individual li,e "System" means what , form which class and why it is used
    simillary for "out" and "println"

    There is a class called System.
    It has a static member attribute called "out", which is of type PrintStream.
    PrintStream provides a method called "println", which is what you're calling.
    Here's a similar example:
    // This is playing the role of PrintStream
    public class Foo {
       // This method is playing the role of println()
       public void bar() {
          System.out.println("Hello");
    // This is playing the role of System
    public class Test {
       // This attribute is playing the role of the out attribute in the System class
       public static Foo out = new Foo();
    // Here's the code to go with it:
    Test.out.bar();  // Prints "Hello"See the similarity ?
    Test.out.bar();versus
    System.out.println("...");The documentation for the System class is here:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html
    The documentation for all the rest of the classes is here:
    http://java.sun.com/j2se/1.4.2/docs/api/index.html

  • What is the different  between System.out.println and out.print

    we move a project , jsp form to servlet to mysql db
    suddenly we get Chinese input problem
    on meantime only Thing I know is
    if( chineseName!=null) {
                           chineseName= new String( chineseName.getBytes("ISO-8859-1"),"UTF-8");
                         out.print(chineseName); //display Chinese
                          System.out.println("Hello1"+chineseName ); // display unread symbol
                 }I don't know why when we insert the value into db by StudentInsert(university_ID, surName, english_Name, chineseName, Address)
    the db get the value from System.out.println
    what setting decide my out put through System.out.println

    Thank you for the reply!
    after two days of search and guess.... I found out
    for Web application , which under glassfish , you need to put your jsp page under WEB-INF,
    other wise the server jsp turn your Chinese character that come from jsp request form to UTF8 symbol.
    not ideal how to change the configuration in glassfish yet!

  • Help: What can make "System.out.println" not displaying anything?

    Hello,
    We have Portal 10g.
    I have noticed a pb on the interpretation of existing JSP pages.
    I simplified the code... and I noticed that even this command doesn't work :
    <%
    System.out.println("Hello World");
    %>
    Any idea ?
    Is there any security ? permission I should get ?
    JSP works fine on our old 8i environment ...
    Thanks in advance for your help.
    Olivier

    Olivier,
    between 8i and 10g are aeons of time (for computer technology). As far as I recall, in 8i came with a Apache and JServ module. This supported Servlets and JSP through a special Oracle implementation. After that OC4J as a J2EE container for EJBs and Servlets/JSPs was introduced.
    Using JSPs with the database installation only is not advised anymore. You can use OC4J for that. But be aware that will require some changes in the configuration and deployment of JSPs.
    HTH,
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Is there a way to make system.out.println() scroll down as it goes?

    I am writing a program where I want to be able to read what's printed out in the console of my IDE through System.out.println() as the program runs/after the program runs. However, right now I run the program, the message prints out, and then when I go to read it the scroll bar is all the way up so I can see only the top of the print-out (the first thing printed out). Is there any way I can get the console to scroll along with the text, kind of like floating boxes you see on various websites for various reasons? In other words, can I get it so that when I look in the console at any given moment of the program running, I am looking at the newest text printed out (the text at the bottom of the "page")? Thank you!

    That would be an IDE problem and not a Java one. You could redirect output into a text file so you can read at your leisure and scroll up and down as much as you like.

  • Is there a way to force System.out.println to run when called

    I working on my first threaded program and having a hard time debugging. I've used System.out.println to let me know what's going on but due (I assume) to the nature of threads the output is not sequential. Is there a way to force println to execute immediatly so that they show up in the order they were called?
    Thanks --- Mike

    mjs1138 wrote:
    endasil, Thanks for the reply. I'm currenlty running the program from within the NetBeans IDE. It is the output displayed by in NetBeans "output" that I'm looking at.
    --- MikeI don't use Netbeans, but I would guess that it too pipes Standard Out and Standard Error to the same console. You didn't address my comment. Are you printing to System.err as well? This happens implicitly if you use Exception.printStackTrace(), for example.

  • How can i put a system.out.println into txt file

    i want to generate a txt file instead of system.out.println. for the output How can i do that and what code can i use for that??
    Edited by: crystalarun on Oct 14, 2007 11:40 AM

    suppose u ant output in "Output.txt"
    then code can be
    PrintStream out = new PrintStream(new FileOutputStream("Output.txt"));
    System.setOut(out)

  • Where to see the System.out.println statements on soa server.

    Hi,
    I have generated some proxy classes in my jdeveloper. And I have deployed that project to the admin server on my soa_domain.
    Now my java files have some System.out.println statements. I want to see those values.
    Can anyone please let me know where I can see those statements on server.
    What s the file name where i can see.
    do i have to enable some debigging on the server. if yes then for what level i need to enable the log at what level.
    Thanks
    Anoop

    Hi,
    System.out.println is not really a good way to debug in weblogic... If you didn't configure where the stdout will go those messages can end up going nowhere...
    I suggest you use one of these...
    This will go to the soa*diagnostic logs... for example DOMAIN_HOME/servers/soa_server1/soa_server1-diagnostic.log...
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import oracle.fabric.logging.LogFormatter;
        private static final Logger soa_logger = Logger.getLogger("oracle.soa.Logger");
        static {
            LogFormatter.configFormatter(soa_logger);
            soa_logger.log(Level.INFO, message);
            soa_logger.log(Level.INFO, message, t);or
    This will go to the server logs... for example DOMAIN_HOME/servers/soa_server1/soa_server1.log...
    import weblogic.logging.NonCatalogLogger;
        private static NonCatalogLogger weblogic_logger = new NonCatalogLogger("SomeMeaningfulNameHere");
            weblogic_logger.notice(message);
            weblogic_logger.notice(message, t);Usually info and notice will go to the logs by default, you can try with higher levels (error,warning) as well or you can tweek the server debug level to use lower levels...
    Cheers,
    Vlad

  • System.out.println - Hello World Example

    Hi All
    I am using Apache Tomcat and trying t produce a simple output to the browser. Cannot get System.out.println to work. See code and out below:
    begin code
    <HTML>
    <HEAD><TITLE>hello jsp</TITLE></HEAD>
    <BODY>
    <%@ page language='java' contentType='text/html' %>
    <%
    String message = "Hello World";
    message = message + "\nAFTER";
    System.out.println("BEFORE");
    %>
    <%= (message) %>
    </BODY>
    </HTML>
    END code
    --begin browser output
    Hello World AFTER
    end browser ouput
    Would be grateful if someone could explain why the System.out.print statement cannot be seen in the browser output.
    many thanks
    Naresh

    System.out prints to System.out. What that is depends:
    In applets, (which the OP was not talking about) it is the Java Console.
    In JSP, it's the same as any application by default.
    You can change in Java what System.out prints to, but you don't often do this. But in JSP it doesn't print to the browser. JSP is not CGI, which does you the standard out as the destination for written data.

  • Print System.out.println messages into logs of Weblogic Application Server

    Hi,
    I use Weblogic Application Server 10.3.6 on Windows 7. The Enterprise Application (J2EE) is deployed into the 'AdminServer' of Weblogic. For debugging purpose, I have added a few System.out.println statements.
    I am unable to see the print messages on any of log files available in path 'user_projects > domains > base_domain > servers > AdminServer > logs'. However, I can see them on the 'command' prompt which was used to start the server. How can I get them into one of the log files? What am I missing?
    I tried reading other threads on the forum and as per them 'System.out.println' gets logged onto *.out logs which I am unable to find. Only base_domain.log, AdminServer.log, access.log are available in the location.
    More Specifics:
    Configuration on WLS console 'Home > Servers > AdminServer > Logging'
    Log file name: logs/AdminServer.log
    Min. Severity to log: Notice (tried with Debug as well)
    Advanced Options:
    Logging Implementation: JDK
    Redirect stdout logging enabled: False (tried both options)
    Log file Severity Level: Notice (tried with Debug as well)
    Standard Out Severity Level: Notice (tried with Debug as well)
    Thanks

    Paul,
    I just found this on google:
    'Generally, developers put a lot of System.out.println statements in their code to perform application debugging. Normally, all standard outputs and error outputs are routed to the console where the OC4J server is started. If you want to capture the standard output and error outputs to files for logging/debugging purposes, then you can use the -out and -err options while starting up the Oc4J server to specify which files to use.'.
    http://www.onjava.com/pub/a/onjava/2002/01/16/oracle.html?page=2

  • Functionality of System.out.println()

    Hello,
    can some one please explain me what happens
    an System.out.println(); is called
    for example when we are pass an Object reference of some class
    it prints the address
    what functionality is taking place internally.
    which methods are called.

    You can look for yourself. The source code for the classes in the core API is in src.zip in the JDK download.

  • Sustitution of System.out.println in Graphical mode

    Dear Sirs:
    I am changing my applications to graphical mode. I would like to know what is the command that substitutes System.out.println in graphical mode. Thanks in advance

    I am not sure exactly what you mean when you say you are changing your apps to graphical mode,
    I assume you will be using Swing?
    If you will be using a gui in the place of a command prompt program, you may need to completely redesign your app (I'm not sure I can help you with that).
    In a Java applet, and application, you can still use System.out.println. It will print to the console while your app runs. I use it pretty often for simple debugging (Although I use JBuilder and the option for the execution Log, if you are in windows and expect the size of the errors to be large an don't have something like this, you may want to run the output into a file using the IO package).
    Hope this helps you,
    Dan Hughes
    Dear Sirs:
    I am changing my applications to graphical mode. I
    would like to know what is the command that
    substitutes System.out.println in graphical mode.
    Thanks in advance

  • System.out.println in gui--- question

    Hello People.
    First of all, I'm new to the forums, so if it doesn't belong here, plese tell me where to post questions like this.
    The Problem:
    I have a GUI and another class,which contains the Program.
    Here's the code of my class:
    int Battle(String CharName) {
              System.out.println(CharName + " Is fighting agains a monster");
              while (CharHP > 0 && MonsterHP != 0) {
                   MonsterHP = MonsterHP - CharDmg;
                   System.out.println("The monster has " + MonsterHP + "Hitpoints left ");
                   CharHP = CharHP - MonsterDamage;
                   System.out.println(CharName + " has " + CharHP + " Hitpoints left");
              if (MonsterHP == 0) {
                   System.out.println(CharName + "Has lost the fight!");
                   CharEXP = CharEXP + 20;
                   System.out.println("You have gained " + CharEXP + " Exp");
              if (CharHP == 0) {
                   System.out.println("You have lost the fight!");
              return CharHP;
         }So what would be the code to print all the "System.out.println's" here into the gui test area?

    camickr wrote:
    Check out the [Message Console|http://www.camick.com/java/blog.html?name=message-console].
    Just out of curiosity, how do you come up with ideas for all the awesome stuff on your blog?

  • System.out.println in iPlanet 6.0

    Hi..All,
    The System.out.println stmt would print out the message when using iPlanet4.x whereas its not doing so when using iPlanet6.0(solaris). What changes/modifications do I have to do to achieve the same.
    Regards,
    Praveen

    Add the following line to your magnus.config file and restart the server.
    Rememeber, to change the server name and path.
    Init fn="nt-console-init" stderr="C:/iPlanet/Servers/https-servername/logs/stderr" stdout="C:/iPlanet/Servers/https-servername/logs/stdout" EarlyInit="yes"

Maybe you are looking for