0% found this document useful (0 votes)
8 views4 pages

Java

Uploaded by

manu prasad
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)
8 views4 pages

Java

Uploaded by

manu prasad
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
You are on page 1/ 4

import java.util.

Scanner;

class

Scanner s=new Scanner(System.in);

String usn,name,branch,phone;

void read()

System.out.println("enter the name");

name=s.next();

System.out.println("enter the usn");

usn=s.next();

System.out.println("enter the brach");

branch=s.next();

System.out.println("enter the phone");

phone=s.next();

void diplay()

System.out.println(name+"\t"+usn+"\t"+branch+"\t"+phone);

public class student {

public static void main(String[] args) {

// TODO Auto-generated method stub


Scanner s=new Scanner(System.in);

student s1[]=new student[10];

System.out.println("enter the number of student");

int n=s.nextInt();

for(int i=0;i<n;i++)

s1[i]=new student();

s1[i].read();

System.out.println("name"+"\t"+"usn"+"\t"+"branch"+"\t"+"phone");

for(int i=0;i<n;i++)

s1[i].display();

import java.util.Scanner;

class

Scanner s=new Scanner(System.in);

String usn,name,branch,phone;

void read()

System.out.println("enter the name");

name=s.next();

System.out.println("enter the usn");

usn=s.next();
System.out.println("enter the brach");

branch=s.next();

System.out.println("enter the phone");

phone=s.next();

void diplay()

System.out.println(name+"\t"+usn+"\t"+branch+"\t"+phone);

public class student {

public static void main(String[] args) {

// TODO Auto-generated method stub

Scanner s=new Scanner(System.in);

student s1[]=new student[10];

System.out.println("enter the number of student");

int n=s.nextInt();

for(int i=0;i<n;i++)

s1[i]=new student();

s1[i].read();

System.out.println("name"+"\t"+"usn"+"\t"+"branch"+"\t"+"phone");

for(int i=0;i<n;i++)

s1[i].display();
}

You might also like