- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestcons.java
More file actions
Latest commit
28 lines (24 loc) · 502 Bytes
/
Copy pathtestcons.java
File metadata and controls
28 lines (24 loc) · 502 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
packagejavatest;
importjava.util.Scanner;
clasststcon{
publictstcon() {
System.out.println("hello from constructor");
}
publicvoidevenodd(inta) {
if(a%2==0) {
System.out.println("even");
}
else {
System.out.println("odd");
}
}
}
publicclasstestcons {
publicstaticvoidmain(String[] args) {
tstconab=newtstcon();
Scannerabc=newScanner(System.in);
System.out.println("enetr the no.");
inti=abc.nextInt();
ab.evenodd(i);
}
}