Task 1:
- Create a class called TV
- Have below method in it. public void watch() { System.out.println("Watching TV"); }
- Save and Compile this class.
- Create another class called Viewer with main method.
- Inside main method, create an instance for TV class. (Instance - object)
- Using created instance, call watch() method.
Input;
Output;
Top comments (0)