Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default System.out.println

    Can give full explanation of System.out.println?
    Dont say System.out.println is method, by using this we can display the information.
    I want what is System and out and println.....?

    Thank You

  2. #2
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Re: System.out.println

    System is a class
    out is a PrintStream.
    PrintStream is an output stream.
    println() is a method in PrintStream.

  3. #3
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: System.out.println

    so, out is class or object?

  4. #4
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Re: System.out.println

    Quote Originally Posted by chandrasekhar.melam View Post
    so, out is class or object?
    It's an object.

  5. #5
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: System.out.println

    Will you plz tell me the following one is true or false
    System is a predefined class belongs to java.io. package. this is class contains several useful class fields and methods. It consists of 3 fields called in, out,err. these fields are the static fields in this class.
    te static fields are invoked directly with the help of class name, without declaring any object of the class

  6. #6
    PhQ's Avatar
    PhQ
    PhQ is offline Senior Member
    Join Date
    Mar 2010
    Location
    Lithuania
    Posts
    358
    Rep Power
    5

    Default Re: System.out.println

    Quote Originally Posted by chandrasekhar.melam View Post
    Will you plz tell me the following one is true or false
    System is a predefined class belongs to java.io. package. this is class contains several useful class fields and methods. It consists of 3 fields called in, out,err. these fields are the static fields in this class.
    te static fields are invoked directly with the help of class name, without declaring any object of the class
    It doesn't belogin in java.io.
    Its in the java.lang package.

    Besides that I think it is true but I'm not 100% sure.

  7. #7
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

    Default Re: System.out.println

    sir, you said the system is class and out is object and println is method in printstream.
    so, if call the println method we should use the object out. ok. why we are write System along the out.println.
    If we write out.println it gives an error msg...

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,412
    Rep Power
    25

    Default Re: System.out.println

    If we write out.println it gives an error msg...
    You need to define the out variable and assign it a value. The System class does that for you.

  9. #9
    Join Date
    Sep 2011
    Location
    India
    Posts
    67
    Rep Power
    0

Similar Threads

  1. Replies: 8
    Last Post: 06-21-2011, 02:21 PM
  2. System.out.println(040|343);
    By satheshshiva in forum New To Java
    Replies: 5
    Last Post: 06-26-2010, 10:26 PM
  3. Println VS system.out.println
    By ccie007 in forum New To Java
    Replies: 2
    Last Post: 05-20-2010, 08:52 AM
  4. difference between system.out.println() & out.println()
    By wickedrahul9 in forum Advanced Java
    Replies: 5
    Last Post: 10-18-2008, 11:06 PM
  5. Help me with system.out.println
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 08:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •