Добавить
Уведомления

Java with IntelliJ 2 - What are these Lines of Code

The lines of code are there so that you are able to write program. Line 1 that says "package tutorial" refers to the package that the class is inside of. A package is a java like folder where you organize all of the java classes in. You don't have to create a package to put your class in. You must put in the package keyword if your class is in the package that you created. Line 3 that says "public class getting_started" is a class declaration. As I mentioned in the last tutorial, every java file is called a class. The syntax for implementing a new java class for every file is "public class [name of the file you created]." Line 5 that says "public static void main(string [] args)" is the main method. In java we call a block of code being encapsulated into one a method. I will show you how to implement a method in a future video. Inside of main, any code you type will run inside of the main method. Line 7 that says "System.out.println("Hello Tut")" is a command that allows you to output text and data. I will talk about data in the next tutorial. Hope this helps! Youtube: https://www.youtube.com/channel/UCLA8... Odysee: https://odysee.com/@King-Tut:e Check out my source code for my Github Page: Github - https://github.com/king-tut-learn Email - kingtutlearning@gmail.com

Иконка канала IT Junction
32 подписчика
12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

The lines of code are there so that you are able to write program. Line 1 that says "package tutorial" refers to the package that the class is inside of. A package is a java like folder where you organize all of the java classes in. You don't have to create a package to put your class in. You must put in the package keyword if your class is in the package that you created. Line 3 that says "public class getting_started" is a class declaration. As I mentioned in the last tutorial, every java file is called a class. The syntax for implementing a new java class for every file is "public class [name of the file you created]." Line 5 that says "public static void main(string [] args)" is the main method. In java we call a block of code being encapsulated into one a method. I will show you how to implement a method in a future video. Inside of main, any code you type will run inside of the main method. Line 7 that says "System.out.println("Hello Tut")" is a command that allows you to output text and data. I will talk about data in the next tutorial. Hope this helps! Youtube: https://www.youtube.com/channel/UCLA8... Odysee: https://odysee.com/@King-Tut:e Check out my source code for my Github Page: Github - https://github.com/king-tut-learn Email - kingtutlearning@gmail.com

, чтобы оставлять комментарии