Java with IntelliJ 2 - What are these Lines of Code

Опубликовано: 15 Декабрь 2021
на канале: King Tut
21
1

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 - [email protected]