DEV Community

Ajay Sundar
Ajay Sundar

Posted on

Learning the Basic programming concepts of java

Learning the basics

Everyday is a learning process. The more i learn a skill the more I get improved and acheive my short term goal which is to get a job as a fresher in the information technology industry.

So I started my learning process by learning some very basics stuffs which is the concept of "Hello World".

public Class main{
public static void main(String[]args){
System.out.println("Hello World!");
}
}

Enter fullscreen mode Exit fullscreen mode

From the above code we get the result as:

output

Hello world !

The other basic feature that i learnt is that

  1. Java is Case Sensitive
  2. "MyClass" and "myclass" has different meaning
  3. Every program must have an main() method.

System.out.println
Inside every main() method we can use the println() method to print a line.
we can print how much ever println() method we want

Public class Main(){
public static void main(String[]args){
System.out.println("Hello World!");
System.out.println("I am learning Java");
System.out.println("It is new and fun");
}
}

Enter fullscreen mode Exit fullscreen mode

Here for the above code the result will be

output

Hello World!
I am learning Java
It is new and fun

System.out.print

This function is similar to println() function
The only difference is that it does not print a new line.

System.out.print("Hello!");
System.out.print("My name is Ajay");

Enter fullscreen mode Exit fullscreen mode

Here for the above code the result will be

output

Hello! My name is Ajay

Java output numbers

We use the println() methods to print the numbers
We do not need double Quotations to print the numbers.

System.out.println(30)
System.out.println(300)
System.out.println(3000)
Enter fullscreen mode Exit fullscreen mode

For the above code the result will be

output

30
300
3000

Conclusion
Today was an important day because it takes a big steps towards my learning progress in java

Here are the things that I learnt today :

  1. How to print a simple Hello World Program
  2. mastering the basic of println() method
  3. mastering the print() method
  4. Learnt how to print output numbers using the println() methods

Top comments (0)