-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject.java
More file actions
38 lines (36 loc) · 847 Bytes
/
object.java
File metadata and controls
38 lines (36 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.*;
class student
{
Scanner sc=new Scanner(System.in);
String name;
int rollno;
int a[]=new int[5];
void read()
{
System.out.print("enter the name");
name=sc.nextLine();
System.out.println("enter the roll no");
rollno=sc.nextInt();
System.out.println("enter the marks");
for(int i=0;i<5;i++)
a[i]=sc.nextInt();
}
void Display()
{
System.out.println("NAME: "+name);
System.out.println("ROLLNO: "+rollno);
System.out.println("MARKS:");
for(int i=0;i<5;i++)
{
System.out.println(a[i]+" ");
}
}
}
class object
{
public static void main(String[] args) {
student s=new student();
s.read();
s.Display();
}
}