forked from icterguru/JavaProgrammingA2Z
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
64 lines (50 loc) · 1.12 KB
/
Copy pathStudent.java
File metadata and controls
64 lines (50 loc) · 1.12 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
package abcPackage;
/*public class Student {
public int Roll;
protected String Name;
private float Mark;
void setData(int Roll, String Name, float Mark) {
this.Roll = Roll ;
this.Name = Name;
this.Mark = Mark ;
}
void display(){
System.out.println("Roll : " + this.Roll );
System.out.println("Name : " + this.Name);
System.out.println("Mark : " + this.Mark) ;
}
}
*/
public class Student {
int Roll;
String Name;
float Mark;
Student() // Default Constructor
{
Roll = 318;
Name = "Masud";
Mark = 85.5F;
}
public Student(int Roll, String Name, float Mark) // Argumented Constructor
{
this.Roll = Roll;
this.Name = Name;
this.Mark = Mark;
}
Student(Student S) // Copy Constructor
{
Roll = S.Roll ;
Name = S.Name ;
Mark = S.Mark;
} // Copy Constructor Defined
void setData(int Roll, String Name, float Mark) {
this.Roll = Roll ;
this.Name = Name;
this.Mark = Mark ;
}
void display(){
System.out.println("Roll : " + this.Roll );
System.out.println("Name : " + this.Name);
System.out.println("Mark : " + this.Mark) ;
}
}