forked from Soumyadeep-Sadhu/HacktoberFest2021-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStudentData.java
44 lines (42 loc) · 852 Bytes
/
StudentData.java
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
import java.util.*;
class Studentt
{
int sno;
String sname;
Scanner sc=new Scanner(System.in);
void get()
{
System.out.println("enter Student roll number:");
sno=sc.nextInt();
System.out.println("Enter Student name");
sname=sc.next();
}
void disp()
{
System.out.println(sno+"\t"+sname);
}
}
class Stud1 extends Studentt
{
String crs;
float fs;
void get1()
{
super.get();
System.out.println("enter course name and fess:");
crs=sc.next();
fs=sc.nextFloat();
}
void disp()
{
super.disp();
System.out.println("course name="+crs);
System.out.println("fess="+fs);
}
public static void main(String[] a)
{
Stud1 ss=new Stud1();
ss.get1();
ss.disp();
}
}