-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathstud.java
More file actions
46 lines (30 loc) · 943 Bytes
/
stud.java
File metadata and controls
46 lines (30 loc) · 943 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
39
40
41
42
43
44
45
46
import java.util.*;
class student{
String name,id,batch;
student(String name,String id){
this.name = name;
this.id = id;
}
student(String name,String id,String batch){
this(name,id);
this.batch = batch;
this.show(this);
}
void show(student t){
System.out.println("name : "+ t.name +" id : "+t.id +" batch : "+ t.batch);
}
}
class stud{
public static void main (String args[]) {
Scanner sc = new Scanner(System.in);
String name,id,batch;
System.out.println("Enter data of student : ");
System.out.println("Enter name : ");
name = sc.next();
System.out.println("Enter id : ");
id = sc.next();
System.out.println("Enter batch : ");
batch = sc.next();
student s = new student(name,id,batch);
}
}