Java – Basics and Comments

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/java-basics-comments/
PINTEREST
PINTEREST
INSTAGRAM

Let’s start with simple Hello Poftut application. In application development comments are important because it provides clues about code. Comments are not included in code whiles compiling, interpreting or executing. They are just text can be read in code to give some hints. In java to mark comments // and /* */ are used .For example in the following code italic part is just comment and not compiled with the application.

Comments are important before beginning because we will use comments to explain code, take notes and similar things. Now actually above code is runnable simple java application. To execute is first we should compile the code. Here we can compile it with cli tool javac or use IDE to make all things. We use eclipse and compile it.

Case Sensitivity

Java is case sensitive language which means using age with AGE is not the same even Age. Always be aware of that because it will give compilation errors.

LEARN MORE  How To Grep Text Files With Powershell Grep or Select-String Cmdlet In Windows?

Age != age != AGE

In this application we focus on public static void main … line and below we will touch other parts later. When an application starts it will look for main method. Program execution instructions runs from top to down.

Comments

Here

part is comment as stated before and compile operation removes them from executable file.

is real code runs when application starts. It simply prints “Hello Poftut”.

Next line is comment to and we added it to explain previous line by simply saying “prints Hello Poftut”. Think it a message to other people that reads this code.

Java expressions end with ; . As you see in example generally all expression lines have ; . Expression is atomic struct to express something like data, operation etc.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/java-basics-comments/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

1 Response

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)