What is meant by printIn( ) ??
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.
What is meant by 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.
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:
result:System.out.println("first line"); System.out.println("second line);
first line
second line