Introduction to Print Statements in Java | Print Text in Java

Published: 26 June 2021
on channel: Thomas Jadallah
1,610
21

How to Print Text in Java | Intro to Java for Beginners - Using Print Statements to Print Text

Today we’ll discuss how to use print statements in Java to print text. We will be showing you how to use print statements in Java to print text on a new line, print text on the same line, and print basic variables.

To print text in Java on a new line, type in the following:
System.out.println(“text here”);

To print text in Java on the same line, type in the following:
System.out.println(“text”);

To print a variable in Java, type in the following:
System.out.print(varName);

Code from video:

public class Main{
public static void main(String args[]){
int var = 15;
System.out.println("text here"); //prints some text on a new line
System.out.print("text here"); //prints some text on the same line
System.out.print(var); //prints var, which represents 15
}
}

If you have any questions, let me know in the comments!

Subscribe: https://bit.ly/3bifwQC

Why you should subscribe:
Here we cover all the latest and greatest Apple products and accessories, jailbreak tweaks, and more
We consistently upload high quality content such as product reviews and tutorials
We also cover the latest new iPhone features and big iOS updates
And finally, we cover great jailbreak apps and jailbreak setups

Follow my Instagram for a sneak peak at future content before its uploaded to YouTube: https://bit.ly/35N3JIX
.
.
.

Timestamps:
00:00 How to Print Text on a New Line in Java
1:38 How to Print Text on the Same Line in Java
2:08 How to Print a Variable in Java
4:06 Key Takeaways


Watch video Introduction to Print Statements in Java | Print Text in Java online without registration, duration hours minute second in high quality. This video was added by user Thomas Jadallah 26 June 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,610 once and liked it 21 people.