- 1
Why do we use this in Java?
Why do we use "println" instead of "printin" when using "System.out.println()"?
10 Antworten
+ 10
Because it was named that way.
ln is short for "line"
+ 4
This naming convention occurs in many programming languages. There are two commonly used functions:
System.out.print()
System.out.println()
The difference is that println adds an extra line break at the end (and typically this is what you want)! So if you want to write multiple things in the same line, you use print().
+ 2
Because the method is named println().
+ 1
Because it is a method.
It is used to change the line.
+ 1
Djdyn0 we can give ln in println statement to print the statement in New line whenever we want to print multiple statements in the program
We can also provide extra line space between the two print statements using \n in the statement itself as like printf statement
Hope you can understand 🙂
+ 1
Because Java uses camel case in it's naming convention
Example is:
toTrim()
printIn()
The first later uses a small letter while the next is a capital.
0
No that was my bad, I assumed it was printin not println because I thought it was saying "print this in here" instead of "print line"
- 1
For a bit more context, my "Hello World" command wasn't working because I used an i instead of an l(lowercase L)
- 1
Well yeah, but why is it named that instead of just printin?
- 1
Oh!!! That makes sense, I thought it was just saying "Print In" as in, print in this, or "Put this in"