0% found this document useful (0 votes)
4 views1 page

Java Program Example: Hello1 Class

The document contains a simple Java program named Hello1 that defines a main method. It initializes variables for a name, a character, and two integers, then calculates their sum. Finally, it prints the values of the variables and the result of the addition to the console.

Uploaded by

nagendra
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Java Program Example: Hello1 Class

The document contains a simple Java program named Hello1 that defines a main method. It initializes variables for a name, a character, and two integers, then calculates their sum. Finally, it prints the values of the variables and the result of the addition to the console.

Uploaded by

nagendra
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

[12:27 PM] Sandhya Singh

public class Hello1 {

public static void main(String[] args) {


// TODO Auto-generated method stub
String name ="John";
char alph ='A';
int numFirst = 5;
int numSecond = 6;
int Result = numFirst + numSecond;
[Link]("Name: "+ name);
[Link]("Alphabet: "+ alph);
[Link]("numFirst: "+ numFirst);
[Link]("numSecond: "+ numSecond);
[Link]("============================");
[Link]("Result : "+ Result);

}
}

You might also like