-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment45.java
More file actions
49 lines (37 loc) · 954 Bytes
/
Assignment45.java
File metadata and controls
49 lines (37 loc) · 954 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
38
39
40
41
42
43
44
45
46
47
package abhilash_Asignments;
//WAP in which abstract class is present along with concrete class
//Abstract class with two abstract methods
abstract class Moniter
{
abstract void Keyboard();
abstract void Mouse();
}
//Concrete class extending the abstract class
public class Assignment45 extends Moniter
{
// Implementing the abstract method Keyboard()
void Keyboard()
{
System.out.println("This is KeyBoard");
}
// Implementing the abstract method Mouse()
void Mouse()
{
System.out.println("This is Mouse");
}
// Concrete method
void concreteMethod()
{
System.out.println("This is a concrete method in the concrete class.");
}
public static void main(String[] args)
{
// Create an instance of the concrete class
Assignment45 ac = new Assignment45();
// Call the implemented abstract methods
ac.Keyboard();
ac.Mouse();
// Call the concrete method
ac.concreteMethod();
}
}