DEV Community

AmalaReegan
AmalaReegan

Posted on

Day 9; Task 1

Ques

**
1.Create a class called TV
2.Have below method in it. public void watch() { 3.System.out.println("Watching TV"); }
4.Save and Compile this class.
5.Create another class called Viewer with main method.
6.Inside main method, create an instance for TV class. (Instance - object)
7.Using created instance, call watch() method.
**

INPUT:1

class Tv
{
public void seeing()
{
    System.out.println("Watching TV"); 
}
}
Enter fullscreen mode Exit fullscreen mode

INPUT:2

class Viewer
{
    public static void main(String[]args)
    {
       Tv child=new Tv();
        child.seeing();
    }
}
Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more