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

Javaa Program

This Java program prints a greeting, performs basic arithmetic, and demonstrates variable assignments. It also takes user input for a number and displays it, along with a predefined string. The program showcases fundamental Java concepts such as data types, input/output, and the use of the Scanner class.

Uploaded by

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

Javaa Program

This Java program prints a greeting, performs basic arithmetic, and demonstrates variable assignments. It also takes user input for a number and displays it, along with a predefined string. The program showcases fundamental Java concepts such as data types, input/output, and the use of the Scanner class.

Uploaded by

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

import [Link].

*;

class FirstClass {
public static void main(String[] args) {
[Link]("Hello World");
[Link]("My First Java Program");
[Link](4+2);
int a=16, B=10;
[Link]("a=" + a);
[Link]("b=" + B);
[Link]("sum of two nummbers:" + (a+B));
float c,d;
c = d =2.3f;
[Link]("c=" + c);
[Link]("d=" + d);
Scanner sc= new Scanner([Link]); //[Link] is a standard
input stream
[Link]("Enter first number- ");
int z= [Link]();
[Link](z);
[Link]();

String name="kamal";
[Link](name);

You might also like