RUVIDEO
Поделитесь видео 🙏

Java Output Statement (System.out.println) explained - Java Tutorial for Beginners

📁 Обучение 👁️ 16 📅 05.12.2023

Java Tutorial - Explaining The Java Output Statement (System.out.println)

In this video I am explaining the Java Output Statement, using this portion of code

public class MyFirstJavaProject
{
public static void main(String[] args)
{
System.out.println("Hello World! This is my first Program");
System.out.println("The sum of 2 and 7 is " + 9);
System.out.println("9 + 5 is equal to " + (9+5));
}
}

When this potion of code is compiled and executed, the following three lines
are displayed in the Eclipse console:

Hello World! This is my first Program
The sum of 2 and 7 is 9
9 + 5 is equal to 14

Explanation:

System.out.println("Hello World! This is my first Program");
This is a classic example of a Java output statement. It actually tells our program to evaluate whatever is written in the parentheses and display the result in the console. Typically, anything written inside the double quotation marks, is considered to be a String and evaluates to itself, that is, its value is the string itself (nb: without quotation marks). Thus, the statement causes the system to display the following line on the screen:
Hello World! This is my first Program


System.out.println("The sum of 2 and 7 is " + 9);
In this output statement, the parentheses contain the string "The sum of 2 and 7 is " , +
(the plus sign), and the number 9. Here the symbol + is used to concatenate (join) the
operands. In this case, the system automatically converts the number 9 into a string, joins
that string with the first string, and displays the following line on the screen:
The sum of 2 and 7 is 9

System.out.println("9 + 5 is equal to " + (9+5));
In this output statement, the parentheses contain the string "9 + 5 is equal to ", + (the plus sign), and
the expression (9+5). In the expression (9+5), notice the parentheses around 9+5.
This is to tell the system to add the numbers 9 and 5, resulting in 14. And then the number 14 is then
converted into the string "14" and then concatenated or joined with the string "9 + 5 is equal to ". Thus, the output of this statement is: 9 + 5 is equal to 14

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Java Output Statement (System.out.println) explained - Java Tutorial for Beginners», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.