Wap in Java to print your name class address on screen
Answers
Wap in Java to print your name class address on screen
Explanation:
//Write a Java program to get student name, class and address
import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
String name,address;
int clas;
Scanner SC=new Scanner(System.in);
System.out.print("Enter Name: "); //input name
name=SC.nextLine();
System.out.print("Enter Class: "); //input class
clas=SC.nextInt();
System.out.print("Enter address: "); //input address
address=SC.next();
System.out.println("Name: "+name);
System.out.println("Class:"+clas);
System.out.println("Address: "+address);
}
}
Output
Enter Name: Hina
Enter Class: 7
Enter address: Enclave
Name: Hina
Class: 7
Address: Enclave
Question:
Wap in Java to print your name class address on screen.
Answer:
import java.util.*;
public class Bio_Data
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in)
String "name", "address";
int c;
System.out.println("Enter the name");
name=in.nextString();
System.out.println("The name is ="+name);
System.out.println("Enter the class");
c=in.nextInt();
System.out.println("The class is="+c);
System.out.println("Enter the address");
address=in.nextString();
System.out.println("The adress is="+address);
}
}
For more java programmings follow the given links as I have solved earlier:
brainly.in/question/14797688
brainly.in/question/16088835
https://brainly.in/question/16131008