0% found this document useful (0 votes)
19 views4 pages

III CSE CS3391 OOP QB Unit1

This document provides an introduction to Object-Oriented Programming (OOP) and Java, defining key concepts such as OOP principles, features of Java, and various programming constructs. It covers topics including abstraction, encapsulation, inheritance, polymorphism, constructors, access specifiers, and control flow statements. Additionally, it outlines the structure of Java programs and includes questions for further exploration of these topics.

Uploaded by

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

III CSE CS3391 OOP QB Unit1

This document provides an introduction to Object-Oriented Programming (OOP) and Java, defining key concepts such as OOP principles, features of Java, and various programming constructs. It covers topics including abstraction, encapsulation, inheritance, polymorphism, constructors, access specifiers, and control flow statements. Additionally, it outlines the structure of Java programs and includes questions for further exploration of these topics.

Uploaded by

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

UNIT 1 - INTRODUCTION TO OOP AND JAVA

2 marks
1. Define Object Oriented Programming
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of
"objects", which can contain data, in the form of fields (often known as attributes/data
members/properties), and code, in the form of procedures (often known as
functions/methods).

2. What are the four principles of OOP?


Abstraction, Encapsulation, Inheritance, Polymorphism

3. What are the features of Object Oriented Programming?


a. Emphasis is on data rather than procedure. Programs are divided into objects.
b. Functions that operate on the data of an object are tied together.
Objects may communicate with each other through functions. Follows bottom-upapproach.

4. What are the features of Java Language?


The features of Java Language are Simple, Object-Oriented, Portable, Platform
independent, Secured, Robust, Architecture neutral, Dynamic,
Interpreted, HighPerformance, Multithreaded and Distributed.

5. What are the operators supported in Java?


Operator in java is a symbol that is used to perform operations. For example: +, -, *, / etc.
There are many types of operators in java which are Unary Operator, Arithmetic Operator,
Shift Operator, Relational Operator, Bitwise Operator, Logical Operator, Ternary Operator
and, Assignment Operator.

6. Define Abstraction.
Abstraction refers to the act of representing the essential features without including the
background details or explanations. It reduces the complexity and increases the efficiency. Small
programs can be easily upgraded to large programs. Software complexity can easily be
managed.

7. What is Polymorphism?
Polymorphism is the ability to take more than one form and refers to an operation
exhibiting different behavior instances. Object oriented programs use polymorphism tocarry
out the same operation in a manner customized to the object.

8. Define Objects and Classes in Java (Nov/Dec 2018)


A class can be defined as a template/blueprint that describes the behavior/state that the
object of its type support.ie. A class is a blueprint from which individual objects are created
An Object can be defined as an instance of a class. An object contains an address and takes
up some space in memory. Objects can communicate without knowing the details of each
other's data or code

CS3391_OOP_QB
9. Write the syntax for declaration of class and creation of objects?
//Syntax for class
class ClassName{
Access-specifier datatype datamember(s);
Access-specifier method-declaration(s)/definition(s) }
//Syntax for object
ClassName objectName=new ClassName();

10. Define Encapsulation


The wrapping up of data and functions into a single unit is known as data encapsulation.
Here the data is not accessible to the outside the class. The data inside that class is
accessible by the function in the same class. It is normally not accessible from the outside of
the component.

11. What is Inheritance? What are its types?


Inheritance is a mechanism of reusing the properties and extending existing classes without
modifying them, thus producing hierarchical relationships between them.
Types: Single inheritance, Multi-level inheritance, Hierarchical inheritance, Hybrid
inheritance.

12. What is Constructors in Java? What are its types? (Nov/Dec 2020)(Apr/May 2021)
A constructor is a special method that is used to initialize an object. The name of the
constructor and the name of the class must be the same. A constructor does not have any return
type.
There are two types of Constructor
Default Constructor – constructor without argument Parameterized constructor – constructor
with argument

13. How will you declare a two dimensional array?


The two dimensional array can be declared and initialized as follows
Syntax: data_type array_name[][]=new data_type[size][size];For example: int a[][]=new int[3]
[3];

14. Define access specifier/modifier? (Nov/Dec 2018) (Nov/Dec 2019)


Access specifiers/modifiers in Java helps to restrict the scope of a class,
constructor,variable, method or data member. There are four types of access modifiers
available injava:Default – No keyword required , Private , Protected and Public

15. What is the use of static keyword in Java?


The static keyword in Java is used for memory management mainly. We can apply java static
keyword with variables, methods, blocks and nested class. The static keyword belongs to the
class than an instance of the class

CS3391_OOP_QB
16. Can a java Source file be saved sing a name other than the class
name?Justify.
Yes, you can save your java source code file with any other name, not same as your main
class name but when you comiple it than byte code file name will be same as your main
class name.

17. What are the control flow statements in java?


if, if-else, nested-if , if-else-if,switch-case,jump – break, continue, return

18. What is JavaDoc?

Javadoc is a tool in Java programming that automatically generates documentation from


comments in the source code.
Javadoc comments are written using a specific syntax. They start with /** and end with */.

19. What do you mean by Dynamic Initialization?


Java is a flexible programming language which allows the dynamic initialization of variables. In
other words, at the time of declaration one can initialize the variables. In java we can declare the
variable at any place before it is used.Eg: int a=10; float d=2.34f;

20. List the programming Structures in JAVA.


Sequential Structure, Branching, Looping, Iterative Structure, Exception, methods and
Functions

CS3391_OOP_QB
UNIT-I / PART-B
(i) Explain the characteristics of OOPs (Nov/Dec 2018)
(ii) Explain the features and characteristics of JAVA(Nov/Dec 2019)
i) Describe the typical java program structure.
ii) Explain the general java program compilation and execution.
What are the different data types in JAVA? Explain each of them with example.
What is Constructor in JAVA? Explain the different types of Constructor?
Discuss in detail the access specifiers available in Java.
What are the different access specifiers and explain them in detail.
Explain Constructors with examples.
Explain in detail the various operators in Java.
Explain the concepts of arrays in Java and explain its types with examples?
Explain in detail about static variable and static method in Java with example?
Discuss the three OOPS principles in detail.(Apr/May 2019)
What are literals? Explain the types of literals supported by Java.(Apr/May 2019)
Explain the Selection statements in Java with suitable examples.(Apr/May 2019)
Write a Java code using do-while loop that counts down to 1 from 10 printing exactly ten
lines of ―hello‖.(Apr/May 2019)
Write in detail about different access specifiers with example program.
Develop a java program to find the smallest number in the given array by creating one
dimensional array and two dimensional array using new operator.(Nov/Dec 2019).
(i) What is a method? How method is defined? Give example (Nov./Dec.2018)
(ii) State the purpose of finalize() method in java. With an example explain how
finalize() method can be used in java program
What are the three categories of control statements used in Java? Explain each category
with example. (Nov/Dec 2020)(Apr/May 2021)

CS3391_OOP_QB

You might also like