Introductory to object-oriented programmin UE Past Papers Questions.


View All Courses

(4383) Question Category: Short answers

Study the following program and answer the questions below;

/**

 A java program to demonstrate packages

**/

   package demopack;

   class Person{

   //eating method

   void eat()

   {

    System.out.println(“Mammals breat feed”);

   }

  }

  class Tester{

  public static void main(String args[])

  {

  }}

  1. What should be the name of the file?
  2. What is the name of the package?
  3. Write one statement that can be used to compile the program
  4. Write a Java statement that can be used to instatiate class Animal above using “sungura” as the name of the object.
  5. In class Tester there is a statement “public static void main(String args[])” which is always the case for a main method. Explain the meaning for each keyword; Public, Static, Void, Main()
  6. What should be the name of the folder for saving this program?

 

Answer / Solution

UNSOLVED


View All Courses
News & Updates | Recently
Recent Updates
questions

2024-05-02: questions

Questions Uploaded on 2024-05-02


questions

2024-03-29: questions

Questions Uploaded on 2024-03-29


questions

2024-03-19: questions

Questions Uploaded on 2024-03-19

Dismissible in 10 seconds