0% found this document useful (0 votes)
35 views1 page

Assignment - Chapter 4-JAVA-OOP-Prog

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Assignment - Chapter 4-JAVA-OOP-Prog

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment No.

4
JAVA OOPS CONCEPTS
TYPE A: VERY SHORT ANSWER QUESTION
1. Fill in the blanks-
(a) Three important concepts of OOPs are -----------, ------------- and -------------.
(b) A class is Java may contains -------------- members and ----------- members.
(c) The keyword -------------- is used to derive a subclass from super class.
(d) The number and type of arguments of a method are known as _____________.
(e) The first line of method definition that tells about the type of return value along with number and
type of arguments is called_____________.
(f) A member method having the same name as that of its class is called______method.
(g) The keyword_________refers to current object.
(h) A class in which methods having no method body is called --------- class.
(i) A ------------ method is one that does different things depending upon the object that invokes it.
(j) A ------------ keyword is used to instantiate an object.
2. We would like to make a member of a class visible in all subclasses regardless of what package they
are in. Which key words would achieve this?
3. What will be the scope of:
(a) A public member (c) A protected member
(b) A default member (d) A private member
4. Write two advantages of User defined methods?
5. What is package? How you can use Java packages in your applications?
TYPE B: SHORT ANSWER QUESTION
1. What is class and object? How object is created?
2. Define inheritance? Discuss its various forms.
3. Explain two advantages of inheritance?
4. What is Package? Which package is imported by default in Java application?
5. Differentiate the following-
(a) Procedural Programming & Object Oriented Programming.
(b) Instance Members & Static Members
(c) Private members & Public Members
(d) Protected members & Private members
6. What do you mean by Base class and Derived classes? How are these related?
7. Define a class for date with data members like day, month, year and functions like constructors,
printing a date, validating a date etc.
8. What is the difference between protected and private members?
9. What do you mean by abstract class and abstract methods?
10. What do you mean by Method Overloading? Explain with an example.
11. Write a method in Java to do the following (assume method name and parameter yourself)-
a. A method takes two integer numbers and returns sum of them.
b. A method that takes an integer number and returns 1 if it is even otherwise returns 0.
c. A method that takes two integer arguments and returns 0 if both the arguments are equal,
return -1 if the first argument is smaller than the second and 1 if the second argument is
smaller than the first?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy