Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: PrintIn( )

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PrintIn( )

    What is meant by printIn( ) ??


  2. #2
    Junior Member
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Re: PrintIn( )

    The println is a method of System.out Object that is integrated in java.lang package.. It is used like a cout in C++, we use a System.out.print(); when we want result in a single row,otherwise we use System.out.println() that is used to return a result in a new paragraph.Println method return String in fact every thing in his space better to say body convert it in string and show u in the console ex. System.out.println( 5+" equals "+ 5); execution trace:
    1.> System.out.println(5+"equals 5");
    2.>System.out.println("5 equals 5");
    //And all what u see in u'r console is :

    5 equals 5.

  3. #3
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: PrintIn( )

    PrintIn (with an upper-case I as in Igloo) or Println (with a lower-case l as in leopard)?

    I have no idea what the first one could be. It's not in the standard Java SE API, but could be in some external library you are using. If so, please tell us which library it's from.
    The second one is as MaGgy described. It also prints out a line-separator string (on windows, it's \r\n, on Linux and possibly mac it's just \n).

    ex:
    System.out.println("first line");
    System.out.println("second line);
    result:

    first line
    second line