Write a java program to demonstrate structure of java program
Answers
Answered by
7
Here is a java program with an Application Programming Interface (API)
class example {
/*this is a multi-line comment input*/
public static void main (String args []) // This explains that the program does return anything.
{
int a, int b ; //Here we declare the integer datatype variable.
a = 25 ;
b = 86 ;
System.out.print("Sum =" + (a+b)) ; // here we are adding the above integers.
}
}
hope,this helps.....
class example {
/*this is a multi-line comment input*/
public static void main (String args []) // This explains that the program does return anything.
{
int a, int b ; //Here we declare the integer datatype variable.
a = 25 ;
b = 86 ;
System.out.print("Sum =" + (a+b)) ; // here we are adding the above integers.
}
}
hope,this helps.....
Answered by
6
Here is the main thing:-
Public:- access Identifier
Static:- Memory management
void:- Return Type
main:- Method main
Here is a demo:-
class Ankit
{
public static void main( Strings args[])
{
System.out.println("Hi! Everyone");
}
}
Hope it Helps ...
Similar questions