- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsports.java
More file actions
Latest commit
70 lines (65 loc) · 1.16 KB
/
Copy pathsports.java
File metadata and controls
70 lines (65 loc) · 1.16 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author g1.test1
*/
classstudents
{
introllNo;
voidset(intn)
{
rollNo=n;
}
voidputNo()
{
System.out.println("roll no="+rollNo);
}
}
classtestextendsstudents
{
floatpart1,part2;
voidgetMarks(floatm1,floatm2)
{
part1=m1;
part2=m2;
}
voidputMarks()
{
System.out.println("marks obtained");
System.out.println(part1);
System.out.println(part2);
}
}
interfacesport
{
floatsport_wt=6.0f;
voidputwt();
}
classresultextendstestimplementssport
{
floattotal;
publicvoidputwt()
{
System.out.println("sport wt="+sport_wt);
}
voiddisplay()
{
total=part1+part2+sport_wt;
putNo();
putMarks();
putwt();
System.out.println("total score"+total);
}
}
publicclasssports {
publicstaticvoidmain(Stringargs[])
{
resultstud1=newresult();
stud1.set(23);
stud1.getMarks(47.5f,93.0f);
stud1.display();
}
}