-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaces.java
More file actions
37 lines (24 loc) · 804 Bytes
/
Copy pathInterfaces.java
File metadata and controls
37 lines (24 loc) · 804 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
29
30
31
32
33
34
35
36
37
interface A{
int age=22; //These variables are by default "public, static & final"
String name="Aditya Singh"; //These variables are by default "public, static & final"
void show(); //by default these methods are "public abstract"
void config(); //by default these methods are "public abstract"
}
class B implements A{
public void show() //Implemenation of the abstract methods
{
System.out.println("In the show...");
}
public void config() //Implemenation of the abstract methods
{
System.out.println("In the config...");
}
}
public class Interfaces{
public static void main(String[] args){
B obj=new B();
obj.show();
obj.config();
System.out.println("Name- "+obj.name+", Age- "+obj.age);
}
}