CHETHAN RAJ C Asistant Profcssor in CSE Dcpt
// Ali Programs are Verified by using the platform Ubuntu 16.04 vcrsion.
l)a Create a Java class called Student with the following details as variables within it.
(i) USN
(ii) Nanic
(iii) Branch
(iv) Phone
Write a Java program to create nStudent objects and print the USN, Na me, Branch, and Phone of these objects wilh suitable headings.*/
import java.util.Scanner; class SCudentDetails {
String USN, Name, Branch, Phone;
Scanner input = new Scanner(System.in); void rcad()
Sysiem.out.printlnCEnter the Student Details\n"); Syslem.out.prinllnCEnler USN”);
USN = input.nextLine(); System.ouLprintln("Entcr Name");
Name = input. nextLme(); System.out.prinllnCEnter Branch");
Branch = input.nextLine(); System.out.priniln("Entcr Phone");
Phone = input.nextLine();
&
void displayO
System.out.printf("%-20s %-20s %-20s %-20s", USN, Name. Branch, Phone);
: class Student 1 public static void main(String[] args)
Scanner input = new Scanner(System.in);
System.out.printlnCEnter number of student details to be created"); int number = inpul.ncxtlnt();
Student s[] = new Student [number];
// Read student details into array of student objects for (int i = 0; i < number; i++)
Che tli a n Raj C, Asst Professor Dept. of CSE Page 1