It is very important to know about Java Syntax to learn Java programs. We must learn Java programs as long as we need to develop Android software. You can use other languages to develop Android software. We will now learn about Java Syntrax and how it works. Java Syntrax is discussed below: -
package com.onlineashikhi; |
public class Main { |
public static void main(String[] args) { |
// write your code here |
System.out.println( "Hello World" ); |
System.out.print( "Hello World" ); |
} |
} |
Output :-
Hello World
Hello World
We printed it here ("Hello world"). Each Java file contains one class and each class will have a main method. When a program is run in Java, the Java program is run from the first main method.
A class named (Main) has been created in the above-mentioned program. The first letter should be a capital letter when creating a class. We need to keep in mind that Java is a case sensitive programming language. For example: - “myclass” and “MyClass” have completely different meanings.
public static void main(String[] args) { } |
The program is run from the first Main Method in Java. However, some keywords have been used here before (main method). Let's take a look at these.
This method is used to print something in Java. This (println ()) method is to be used in the main method. This method is used to print new lines.
Note :- The semicolon has to be given after the end of each statement. And any class and method begins with "{" and ends with "}". In Java, this bracket is called Carly Bases "{}".
If you have any comments or suggestions on this topic,follow Countuct Us page. please let us know. Thanks you
All these issues will be brought to the web site very soon. We are currently working on all these issues. ...
onlineashikhi.com provides good quality services. For details please mail us onlineashikhi@gmail.com to get all our services. I think it will help you a lot of to learn about computers and programs.