0% found this document useful (0 votes)
5 views3 pages

Tutorial Questions For Exams

Object Oriented Programming II

Uploaded by

myworkmyangel
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)
5 views3 pages

Tutorial Questions For Exams

Object Oriented Programming II

Uploaded by

myworkmyangel
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/ 3

Tutorial Questions for Exams

(a) What is Object oriented programming?


(b) Define the following concepts of OOP
i. Object
ii. Class
iii. Method
iv. Polymorphism
v. Inheritance
vi. Constructor
vii. Method overloading

viii. Method overriding


ix. Abstraction
(c) Difference between
i. Class and object
ii. Abstraction and encapsulation
(d) (i) How do you declare object in Java programming language?
(ii) What is the function of ‘new’ keyword in java programming language
(iii) State six benefits of OOP
(e) What is an instance variable?
(f) State translators used and their functions in Java programming language
(g) Explain the function of each of the components of java:
i. JRE
ii. JVM
iii. JDK
(h) (i) Define constructors
(ii) What are the functions of constructors
(iii) How do you create constructors?
(iv) How do you overload constructors?
(v) What are the rules of constructors?
(vi) Define default and parameterized constructors
(i) State the uses of final keyword in java programming
(j) Classify and state reason for legal/illegal identifier
i. boolean is Bad=2;
ii. char second=a;
iii. int 2a=89;
iv. String regno=2023-08-1756
v. int student grade=89;
vi. Double $ class=5.0;
vii. int_parents=15.0;
viii. String a="Brian"

Theory Questions
Question 1

You are developing a simple book management system in Java. Each book has attributes like
Author, Title, publicationYear.
(i) Create a package called “Book”
(ii) Import a Scanner class. Briefly explain how compiler locate the class Scanner and what scanner
class is used for.
(iii) Create a Class Book
(iv) Declare the attributes like Author, title, publicationyear as instance variables
(v) Create a method called “displaydetails” and use the method to print out the Book's details.
(vi) Create Second class called "BookManagement" and a main method. Create a new book object
and allocate memory to it.
(vii) Set book attributes using scanner class and display the book details

Question 2
i. Develop a java program to test equality of two numbers
ii. Develop a java program to determine positive or negative number
iii. Develop a java program to determine even or odd numbers

Question 3

i. Write a code to print first 10 numbers (1-10)

ii. Write a java code to print first 10 numbers

iii. Write a java code using a=l* b using two methods (refer to all CAT questions as well)
Question 4

(a) Identify and correct errors in program (refer to CAT questions and coursework)

(b) You are tasked with developing a Car Management System in Java. Each student will
have attributes such as make, model and year. A constructor will be used to initialize the
attributes of the student objects. The system should be flexible enough to create car
objects with different sets of initial information.
(i) Create a car constructor with only a make.
(ii) Create a car constructor with a make and model.
(iii) Write a car constructor with make, model, and year.

(c) Inheritance (refer to coursework and practice all)

You might also like