-
Notifications
You must be signed in to change notification settings - Fork 2
/
testString.java
132 lines (101 loc) · 2.28 KB
/
testString.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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
private King king;
private Castle castle;
private Army army;
public void createKingdom(final KingdomFactory factory) {
setKing(factory.createKing());
setCastle(factory.createCastle());
setArmy(factory.createArmy());
}
}
public class Student extends App{
private int sid;
private String sname= "student name";
private String Address;
public void print(x,y){
print(this);
}
public void delete(){
delete.all();
system.out.print("this is"+sname)
y=x+1-3;
x++;
y--;
r += 8;
if(y==x)
{
if(t!=u){
thhhd;
}
fdg
}
if((y||u)&&(r||y)
dhh;
}
public void createKingdom(final KingdomFactory factory) {
setKing(factory.createKing());
setCastle(factory.createCastle());
setArmy(factory.createArmy());
if(x || y){
do.this;
}
}
int rtt;
private int sid;
private String s_name;
private String address;
//default constructor
public Student() {
this.address = "Rathnapura";
}
//para constructor
public Student(int sid, String s_name) {
this.address = "Rathnapura";
this.sid = sid;
this.s_name = s_name;
}
//coping constructor
public Student(Student s) {
this.address = s.getAddress();
this.sid = s.getSid();
this.s_name = s.getS_name();
}
public int getSid() {
return sid;
}
public void setSid(int sid) {
this.sid = sid;
}
public String getS_name() {
return s_name;
}
public void setS_name(String s_name) {
this.s_name = s_name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public void print() {
System.out.println(this.s_name);
}
public static void main(String[] args) {
//Declureing Object
Student s1 = new Student(100,"Kuura");
Student s2 = new Student(101,"pavithra");
Student s3 = new Student(s1);
//Calling functions
// s1.setSid(100);
// s1.setS_name("Kuura");
// s1.setAddress("Rathnapura");
System.out.println(s1.getSid());
System.out.println(s1.getS_name());
System.out.println(s1.getAddress());
s1.print();
s2.print();
s3.print();
}
}