DEV Community

AmalaReegan
AmalaReegan

Posted on

Day8

Ques:
**

  1. Create a class Library'
  2. Have main method in it.
  3. Inside main method, create an instance called'book'. 4, Usung'book', reference, call a method called' read (300).
  4. In read (int pages) method, return pages. 6 Store returned values as pa
  5. Print pa in main method.**

Input:

public class Library
{
public static void main(String[]args)
{
Library book=new Library();
book.read();
book.page(300);
}
public void read()
{
System.out.println("read");
}
public void page(int no1)
{
System.out.println(300);
}
}
Enter fullscreen mode Exit fullscreen mode

Output:

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