Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to print two variables in same line in java

// Let var1 be the first variable and var2 the second
System.out.print(var1 + " " + var2); // does not advance to next line

// Or alternatively
System.out.println(var1 + " " + var2); // prints and then advances to next line
 
PREVIOUS NEXT
Tagged: #print #variables #line #java
ADD COMMENT
Topic
Name
4+8 =