SlideShare a Scribd company logo
1 of 53
CHAPTER 8
CLASSES AND
OBJECTS IN JAVA
Important MCQs
Compiled by Nuzhat Memon
2
1. What do you mean by class?
a) Data & program code
b) Data & method
c) Only data
d) Only program code
2. Which of the following is the correct syntax for defining a
class ?
a) class [class name] { <variable><methods>}
b) class <class name> {<variable> <methods>}
c) class {class name} ( <variable> <methods> )
d) class (class name) { <variable> <method> }
Compiled by Nuzhat Memon
3
3. In class, Data is referred to as____________
a) attributes
b) behavior
c) state
d) None of these
4. In Java, functions referred to as __________
a) attributes
b) behavior
c) state
d) None of these
Compiled by Nuzhat Memon
4
5. In Java, by which component is the class generally
made up of?
a) Name, variable
b) Behaviour , variable
c) Name, attributes
d) Attributes, behaviour
6. In java, which of the following defines attributes and
methods?
a) Class
b) Object
c) Instance
d) Variable
Compiled by Nuzhat Memon
5
7. ___________ is a template for multiple objects with
similar features.
a) Public
b) Main
c) Static
d) Class
8. In Java, a class is defined using which keyword ?
a) public
b) main
c) static
d) class
6
9. What are defined by variables in a class ?
a) Attribute
b) Behaviour
c) State
d) Methods
10. What are defined by method in a class?
a) Class
b) State
c) Attribute
d) Behaviour
7
11. Which of the following is used to access or modify
attributes?
a) Class
b) State
c) Attribute
d) Method
12. Variables belongs to a class and not to an ......
a) Object
b) Attribute
c) Behaviour
d) Method
Compiled by Nuzhat Memon
8
13. In Java, which operator allocates the memory
for an object and returns the address of object?
a) add
b) class
c) super
d) new
14. What is the name of the data structure, where
all instances of class are allocated memory?
a) reference
b) heap
c) class
d) variable
Compiled by Nuzhat Memon
9
15. Variable of class type are also referred to as
_______variables.
a) Global
b) Reference
c) Allocated
d) Constant
16.What do we call the address of the memory
location where the object is stored?
a) Reference
b) Address
c) Allocated
d) Constant
Compiled by Nuzhat Memon
10
17. Which steps are required to create an object from a
class in java?
a) declaration
b) instantiation
c) initialization
d) all of these
18. In object oriented programming (OOP) language,
creating an object is also known as what?
a) object instantiation
b) object creating
c) object making
d) none of these
Compiled by Nuzhat Memon
11
19.In Java, which step of creating an object from a
class initialize the newly created object ?
a) Declaration
b) Instantiation
c) Initialization
d) All of these
20. Java have a ..... that looks for unused objects and
reclaims the memory that those objects are using.
a) Unused collector
b) Garbage collector
c) Reclaim collector
d) Memory collector
Compiled by Nuzhat Memon
12
21. In Java class, in which step a ‘new’ keyword is used
to create the object by allocating memory?
a) Declaration
b) Instantiation
c) Initialization
d) All of these
22. ____________ is special kind of method called to
initialize the newly created object.
a) classes
b) reference variable
c) syntax variable
d) constructor
Compiled by Nuzhat Memon
13
23. A variable declared using class type can only store
what?
a) store an object
b) reference to an object
c) classified an object
d) interfere an object
24. In java, Which of the following is not a step of
creating an object from a class?
a) Declaration
b) Instantiation
c) Initialization
d) Calculation
Compiled by Nuzhat Memon
14
25. Which of the following is the correct syntax to
declare and create an object in a single line ?
a) Room r2=new Room( );
b) Room r1=room()
c) Room r=room();
d) Room = Room(new);
26. When statement “r1= new Room( );” is executed
then what is stored in r1?
a) Heap
b) Address of an object
c) Reference of an object
d) All of these
Compiled by Nuzhat Memon
15
27. Declaring a variable does not create an ______ in
java.
a) Method
b) Attribute
c) Behaviour
d) Object
28. When a program contains 2 or more classes, only
one class can contain the _____________ method
a) private
b) class
c) string()
d) main()
Compiled by Nuzhat Memon
16
29. Which of the following represents the type of variable ?
a) Instance variables
b) Local variables
c) Class variables
d) All of these
30. Variables defined inside methods or blocks are known as
which type of variable ?
a) Local variables
b) Block variables
c) Instance variables
d) Class variables
Compiled by Nuzhat Memon
17
31. Which type of variables is created at the time
of creating an object and stay throughout the life
of the objects?
a) Local
b) Instance
c) Static
d) Null
32. Which type of variable is define by the
attributes of an object?
a) Local
b) Instance
c) Static
d) Null
Compiled by Nuzhat Memon
18
33. Which is the correct syntax of accessing and calling instance
variable?
a) <object reference>.<instance variable or method>
b) <instance variable or method>.<object reference>
c) (object reference).(instance variable or method)
d) None of these
34. Which of the following is used to invoke an instance method in
java ?
a) The name of the object, colon(:) and the name of the
method.
b) The name of the class, colon(:) and the name of the method.
c) The name of the object, dot(.) and the name of the method.
d) The name of the class, dot(.) and the name of the method.
Compiled by Nuzhat Memon
19
35. From which of the following operators can we access
instance variables and instance methods ?
a) . ( dot)
b) : ( colon)
c) , ( comma)
d) ; ( semi colon)
36. What is the associativity of . (dot) operator which is
used to access instance variable ?
a) Upper to Lower
b) Right to Left
c) Lower to Upper
d) Left to Right
Compiled by Nuzhat Memon
20
37. Which type of variables are defined within a class but
outside any method?
a) Class variables
b) Block variables
c) Instance variables
d) Local variables
38. Which type of variables are defined within a class but
outside any method with static keyword?
a) Class variables
b) Block variables
c) Instance variables
d) Local variables
Compiled by Nuzhat Memon
21
39. Referring instance variable or invoking method with
null reference will give _____
a) Output
b) Object
c) Class
d) Error
40. Which variables are initialized with default value?
a) class and local variables
b) Instance and class variable
c) class and static variable
d) local and instance variable
Compiled by Nuzhat Memon
22
41. ________ are created when the method or block is
started and destroyed when the method or block has
completed.
a) Instance variable
b) Class variable
c) Local variable
d) None of these
42. Which of the following method can be called without
creating an instance of a class ?
a) Instance method
b) Class method
c) Constructor method
d) All of these
Compiled by Nuzhat Memon
23
43. How do you identify the variable which is define with
in a class, out-side any method with the static key word
in Java ?
a) Block variables
b) Local variables
c) Instance variables
d) Class variables
44. Which of the following keyword is used to declare
Class variables and class methods ?
a) private
b) static
c) package
d) public
Compiled by Nuzhat Memon
24
45. Which of the following is accessible by instance methods ?
a) Only class variables
b) Only instance variables
c) Both instance variables and class variables
d) Constructor
46. Which of the following is accessible by class methods ?
a) Only class variables
b) Only instance variables
c) Both instance variables and class variables
d) Constructor
Compiled by Nuzhat Memon
25
47. Constructor is invoked implicitly only when an object is
constructed using ______ operator
a) default
b) new
c) new()
d) +
48. Constructor must have the _____ name as class name.
a) New
b) Same
c) Different
d) Default
Compiled by Nuzhat Memon
26
49. In Java, which method is invoked automatically with
creation of an object ?
a) Instance method
b) Class method
c) Constructor
d) None of these
50. Which of the following can perform any action, but it is
mainly designed to perform initializing actions ?
a) Consolidation
b) Constructors
c) Confirmation
d) Contractor
Compiled by Nuzhat Memon
27
51. Which constructor is called with empty
parenthesis without arguments ?
a) Default constructor
b) Object constructor
c) Method
d) Parameterized constructor
52. Every class is having its default .........................
a) Inheritance
b) Constructor
c) Polymorphism
d) All of these
Compiled by Nuzhat Memon
28
53. In absence of user define constructor in a class, objects
are constructed using which type of constructor ?
a) No – argument
b) Parameterized
c) Multi level
d) Default
54. Which of the following is known as a user – defined no –
argument constructor ?
a) <classname> () {};
b) <classname> () [ ];
c) <classname> () [ ];
d) <classname> [ ] ();
Compiled by Nuzhat Memon
29
54. Which type of constructor does not take any argument ?
a) Default
b) Multiple
c) Multi level
d) Parameterized
55. Constructor does not have _______ type.
a) void()
b) Return
c) Default
d) All of these
Compiled by Nuzhat Memon
30
56. Which of the following is the correct for the
constructor ?
i. Constructor must have the same name as class name.
ii. Constructor does not have return type.
iii. Constructor is invoked implicitly only when an object
is constructed using new operator.
iv. Constructor can not be invoked explicitly elsewhere in
the program.
v. Constructor can be invoked implicitly.
a) i, ii, v, iii
b) i, ii, iii, iv
c) v, i, iv, iii
d) v, i, iii, iv
Compiled by Nuzhat Memon
31
57. Which word means “many forms”, different forms of
method with same name in Java?
a) Aggregation
b) Polymorphism
c) Composition
d) None of these
58. Which of the following are the steps to create
Polymorphism?
a) Method name
b) Type of return value
c) A list of parameters
d) All of these
Compiled by Nuzhat Memon
32
59. In java, we can have different methods that have the
same name but a different signature is also called as what ?
a) overloading method
b) Overridden method
c) overloading class
d) Overridden signature
60.When methods in superclass and subclass have same name
and signature, what are they called?
a) Overloaded methods
b) overridden methods
c) Inherited methods
d) All of the above
Compiled by Nuzhat Memon
33
61. What is known as visibility modifier ?
a) Constructor
b) Inheritance
c) Polymorphism
d) Access modifier
62. Access control means to control ...........
a) Visibility
b) Objects
c) Program
d) Attributes
Compiled by Nuzhat Memon
34
63. In Java, how many levels of visibility modifiers are
available for access control ?
a) 5
b) 3
c) 4
d) 2
64. Which are the for P’s used in the four levels of visibility to
provide necessary protection ?
a) Process, Private, Protected, Public
b) Public, Package, Protected, Process
c) Public, Package, Protected, Private
d) Private, Package, Protected, Public
Compiled by Nuzhat Memon
35
65. Match the correct access modifier with its visibility
a) 1- C, 2- A, 3- B, 4- D
b) 1- C, 2- A, 3- D, 4- B
Access modifier Visibility
1 Public A   
2 Default: Package B Narrowest
3 Protected C Widest
4 private D  
Compiled by Nuzhat Memon
36
66. Which is the default level of protection, where lack of
any access modifier keyword is in a declaration in Java
a) Private
b) Package
c) Public
d) Protected
67. Which of the following is syntax of package ?
a) Package {Package Name};
b) Package <Package Name>;
c) Package (Package Name);
d) Package [Package Name];
Compiled by Nuzhat Memon
37
68. Which of the following access modifier is used to
organized classes ?
a) Public
b) Package
c) Private
d) Protected
69. Which access modifier provides visibility to classes
defined in the other package ?
a) Package
b) Public
c) Private
d) Protected
Compiled by Nuzhat Memon
38
70. To provide public access, which keyword type before
method or variable type?
a) Private
b) Public
c) Protected
d) Package
71. Public variables and methods are _______anywhere.
a) Invisible
b) Visible
c) Outside
d) Inside
Compiled by Nuzhat Memon
39
72. If we want to make visible to all the classes outside the
class, where method or variable is visible to class,
which type of access modifier is used ?
a) Public
b) Package
c) Protected
d) Private
73. Highest level of protection can be achieved by using
which protection level?
a) Protected
b) Package
c) Public
d) Private
Compiled by Nuzhat Memon
40
74. __________ members are available as ‘private’
members in the inherited subclass.
a) Public
b) Package
c) Protected
d) Private
75. ____________ provides data encapsulation.
a) Protected
b) Package
c) Public
d) Private
Compiled by Nuzhat Memon
41
76. Accessor method is known as what in Java ?
a) set
b) setter
c) getter
d) get
77. Mutator method is known as what in Java ?
a) setter
b) set
c) get
d) getter
Compiled by Nuzhat Memon
42
78. If we want to allow other methods to read only the data
value, then which method is used ?
a) writer
b) reader
c) Getter
d) Setter
79. If we want to allow other methods to modify the data
value, then which method is used ?
a) write
b) getter
c) reader
d) Setter
Compiled by Nuzhat Memon
43
80. In Java, if we want to allow protect data to be used by
others, then which methods are to be written ?
a) Get
b) Mutator
c) Accessor
d) Set
81. In Java, if we want to allow protect data to be modified
by others, then which methods are to be written ?
a) Set
b) Get
c) Mutator
d) Accessor
Compiled by Nuzhat Memon
44
82. Which level of protection is used to allow the access only
to sub classes or to share with the methods declared as
“friend” in Java ?
a) Package
b) Private
c) Public
d) Protected
83.Which keyword is used to share data of private class?
a) Extends
b) Friend
c) Throw
d) Get
Compiled by Nuzhat Memon
45
84. Which of the following allows us to build new class with
added capabilities by extending existing class ?
a) Polymorphism
b) Composition
c) Aggregation
d) Inheritance
85. Inheritance establish which type of relationship
between two classes in java ?
a) is – a
b) has – a
c) have – a
d) are – a
Compiled by Nuzhat Memon
46
86. Inheritance model is based on which type of relationship
between two classes ?
a) Has – a – part
b) Is – a – kind
c) Is – a – kind – of
d) Both b or c
87. In Java, which keyword is used to call the constructor
of super class in the constructor of sub class ?
a) class
b) extends
c) super
d) sub
Compiled by Nuzhat Memon
47
88. Which keyword is used to create a subclass in the class
definition?
a) class
b) extends
c) super
d) Sub
89. What is not inherited in sub class?
a) Constructor
b) Method
c) Polymorphism
d) Super class
Compiled by Nuzhat Memon
48
90. In Java, Parent class can be referred to as which of
the following ?
a) Sub class, Base class, Super class
b) Parent class, Super class, Base class
c) Sub class, Derived class, Extended class
d) Parent class, Extended class, Base class
91. In Java, Child class can be referred to as which of
the following ?
a) Parent class, Extended class, Base class
b) Sub class, Base class, Super class
c) Parent class, Super class, Base class
d) Sub class, Derived class, Extended class
Compiled by Nuzhat Memon
49
92. In inheritance, Parent class is also referred to as ____class.
a) Super
b) Sub
c) Base
d) Both a and c
93. In Java, a Sub class can be derived from which class ? OR
In Java, a Sub class inherits all instance variables and methods
from which class ?
a) Child class
b) Owner class
c) Extended class
d) Super class
Compiled by Nuzhat Memon
50
94. In which class common features are kept?
a) Super class
b) Extended class
c) Sub class
d) Derived class
95. Which class inherits all instance variables and
methods from super class, and it may have its own added
variables and methods?
a) Base class
b) Sub class
c) Super class
d) Parent class
Compiled by Nuzhat Memon
51
96. Which symbol is used in Inheritance ?
a) Triangle
b) Diamond
c) Circle
d) arrow
97. Java does not support ......... type of inheritance .
a) Single
b) Multiple
c) Multi level
d) Constructor
Compiled by Nuzhat Memon
52
98. Composition and Aggregation establish which type of
relationship between classes in Java ?
a) As – a
b) Has – a
c) Is – a
d) Was – a
99. Composition and aggregation establish which type of
relationship between classes?
a) Has – a – part
b) Has – a
c) Is – a – kind – of
d) Both a or b
Thanks!
Any questions?
You can find me at @nuzhatmemon.com and
nuzhat.memon@gmail.com
53

More Related Content

What's hot

Java apptitude-questions-part-2
Java apptitude-questions-part-2Java apptitude-questions-part-2
Java apptitude-questions-part-2vishvavidya
 
Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1Lahari Reddy
 
Java assignment help
Java assignment helpJava assignment help
Java assignment helpJacob William
 
Java questions for viva
Java questions for vivaJava questions for viva
Java questions for vivaVipul Naik
 
03 object-classes-pbl-4-slots
03 object-classes-pbl-4-slots03 object-classes-pbl-4-slots
03 object-classes-pbl-4-slotsmha4
 
Java Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Projects
 
Classes and Objects in C#
Classes and Objects in C#Classes and Objects in C#
Classes and Objects in C#Adeel Rasheed
 

What's hot (17)

Java apptitude-questions-part-2
Java apptitude-questions-part-2Java apptitude-questions-part-2
Java apptitude-questions-part-2
 
Write First C++ class
Write First C++ classWrite First C++ class
Write First C++ class
 
C# Types of classes
C# Types of classesC# Types of classes
C# Types of classes
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Lecture 5
Lecture 5Lecture 5
Lecture 5
 
Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1
 
Java assignment help
Java assignment helpJava assignment help
Java assignment help
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
C++ questions
C++ questionsC++ questions
C++ questions
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Java questions for viva
Java questions for vivaJava questions for viva
Java questions for viva
 
03 object-classes-pbl-4-slots
03 object-classes-pbl-4-slots03 object-classes-pbl-4-slots
03 object-classes-pbl-4-slots
 
Java mcq
Java mcqJava mcq
Java mcq
 
Classes and objects in java
Classes and objects in javaClasses and objects in java
Classes and objects in java
 
Java Multiple Choice Questions and Answers
Java Multiple Choice Questions and AnswersJava Multiple Choice Questions and Answers
Java Multiple Choice Questions and Answers
 
Classes and Objects in C#
Classes and Objects in C#Classes and Objects in C#
Classes and Objects in C#
 
Java Reflection
Java ReflectionJava Reflection
Java Reflection
 

Similar to Std 12 computer chapter 8 classes and objects in java important MCQs

Std 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQsStd 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQsNuzhat Memon
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)Ankit Dubey
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2Knowledge Center Computer
 
Prueba de conociemientos Fullsctack NET v2.docx
Prueba de conociemientos  Fullsctack NET v2.docxPrueba de conociemientos  Fullsctack NET v2.docx
Prueba de conociemientos Fullsctack NET v2.docxjairatuesta
 
CJP Unit-1 contd.pptx
CJP Unit-1 contd.pptxCJP Unit-1 contd.pptx
CJP Unit-1 contd.pptxRAJASEKHARV10
 
CS 192 test questions 1-441. Global variables are known to the e.docx
CS 192 test questions 1-441. Global variables are known to the e.docxCS 192 test questions 1-441. Global variables are known to the e.docx
CS 192 test questions 1-441. Global variables are known to the e.docxfaithxdunce63732
 
Python_Unit_3.pdf
Python_Unit_3.pdfPython_Unit_3.pdf
Python_Unit_3.pdfalaparthi
 
Core java interview faq
Core java interview faqCore java interview faq
Core java interview faqKumaran K
 
Object Oriented Analysis and Design one marks Q & A
Object Oriented  Analysis  and  Design one marks Q & AObject Oriented  Analysis  and  Design one marks Q & A
Object Oriented Analysis and Design one marks Q & Aeeducations ever
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guidekrtioplal
 
Oops concept in c#
Oops concept in c#Oops concept in c#
Oops concept in c#ANURAG SINGH
 
C aptitude 1st jan 2012
C aptitude 1st jan 2012C aptitude 1st jan 2012
C aptitude 1st jan 2012Kishor Parkhe
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaAjay Sharma
 
Devry CIS 247 Full Course Latest
Devry CIS 247 Full Course LatestDevry CIS 247 Full Course Latest
Devry CIS 247 Full Course LatestAtifkhilji
 
OOM MCQ 2018
OOM  MCQ 2018OOM  MCQ 2018
OOM MCQ 2018lochan100
 

Similar to Std 12 computer chapter 8 classes and objects in java important MCQs (20)

Std 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQsStd 12 chapter 7 Java Basics Important MCQs
Std 12 chapter 7 Java Basics Important MCQs
 
Java Programming.pdf
Java Programming.pdfJava Programming.pdf
Java Programming.pdf
 
200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)200 mcq c++(Ankit dubey)
200 mcq c++(Ankit dubey)
 
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
UGC-NET, GATE and all IT Companies Interview C++ Solved Questions PART - 2
 
Prueba de conociemientos Fullsctack NET v2.docx
Prueba de conociemientos  Fullsctack NET v2.docxPrueba de conociemientos  Fullsctack NET v2.docx
Prueba de conociemientos Fullsctack NET v2.docx
 
Part - 2 Cpp programming Solved MCQ
Part - 2  Cpp programming Solved MCQ Part - 2  Cpp programming Solved MCQ
Part - 2 Cpp programming Solved MCQ
 
C# interview questions
C# interview questionsC# interview questions
C# interview questions
 
Faqs in java
Faqs in javaFaqs in java
Faqs in java
 
CJP Unit-1 contd.pptx
CJP Unit-1 contd.pptxCJP Unit-1 contd.pptx
CJP Unit-1 contd.pptx
 
CS 192 test questions 1-441. Global variables are known to the e.docx
CS 192 test questions 1-441. Global variables are known to the e.docxCS 192 test questions 1-441. Global variables are known to the e.docx
CS 192 test questions 1-441. Global variables are known to the e.docx
 
Python_Unit_3.pdf
Python_Unit_3.pdfPython_Unit_3.pdf
Python_Unit_3.pdf
 
Core java interview faq
Core java interview faqCore java interview faq
Core java interview faq
 
Object Oriented Analysis and Design one marks Q & A
Object Oriented  Analysis  and  Design one marks Q & AObject Oriented  Analysis  and  Design one marks Q & A
Object Oriented Analysis and Design one marks Q & A
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
 
Oops concept in c#
Oops concept in c#Oops concept in c#
Oops concept in c#
 
C aptitude 1st jan 2012
C aptitude 1st jan 2012C aptitude 1st jan 2012
C aptitude 1st jan 2012
 
Java14
Java14Java14
Java14
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Devry CIS 247 Full Course Latest
Devry CIS 247 Full Course LatestDevry CIS 247 Full Course Latest
Devry CIS 247 Full Course Latest
 
OOM MCQ 2018
OOM  MCQ 2018OOM  MCQ 2018
OOM MCQ 2018
 

More from Nuzhat Memon

Std 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQsStd 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQsNuzhat Memon
 
Std 10 Chapter 10 Introduction to C Language Important MCQs
Std 10 Chapter 10 Introduction to C Language Important MCQsStd 10 Chapter 10 Introduction to C Language Important MCQs
Std 10 Chapter 10 Introduction to C Language Important MCQsNuzhat Memon
 
Std 12 Computer Chapter 6 object oriented concept important mcqs
Std 12 Computer Chapter 6 object oriented concept important mcqsStd 12 Computer Chapter 6 object oriented concept important mcqs
Std 12 Computer Chapter 6 object oriented concept important mcqsNuzhat Memon
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Nuzhat Memon
 
Std 12 computer chapter 6 object oriented concepts (part 2)
Std 12 computer chapter 6 object oriented concepts (part 2)Std 12 computer chapter 6 object oriented concepts (part 2)
Std 12 computer chapter 6 object oriented concepts (part 2)Nuzhat Memon
 
Std 12 computer java basics part 3 control structure
Std 12 computer java basics part 3 control structureStd 12 computer java basics part 3 control structure
Std 12 computer java basics part 3 control structureNuzhat Memon
 
Std 12 Computer Chapter 7 Java Basics (Part 2)
Std 12 Computer Chapter 7 Java Basics (Part 2)Std 12 Computer Chapter 7 Java Basics (Part 2)
Std 12 Computer Chapter 7 Java Basics (Part 2)Nuzhat Memon
 
Std 12 Computer Chapter 7 Java Basics (Part 1)
Std 12 Computer Chapter 7 Java Basics (Part 1)Std 12 Computer Chapter 7 Java Basics (Part 1)
Std 12 Computer Chapter 7 Java Basics (Part 1)Nuzhat Memon
 
Std 12 Computer Chapter 13 other useful free tools and services important MCQs
Std 12 Computer Chapter 13 other useful free tools and services important MCQsStd 12 Computer Chapter 13 other useful free tools and services important MCQs
Std 12 Computer Chapter 13 other useful free tools and services important MCQsNuzhat Memon
 
Std 12 Computer Chapter 9 Working with Array and String in Java important MCQs
Std 12 Computer Chapter 9 Working with Array and String in Java important MCQsStd 12 Computer Chapter 9 Working with Array and String in Java important MCQs
Std 12 Computer Chapter 9 Working with Array and String in Java important MCQsNuzhat Memon
 
Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)Nuzhat Memon
 
Std 10 computer chapter 10 introduction to c language (part2)
Std 10 computer chapter 10 introduction to c language (part2)Std 10 computer chapter 10 introduction to c language (part2)
Std 10 computer chapter 10 introduction to c language (part2)Nuzhat Memon
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Nuzhat Memon
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingNuzhat Memon
 
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...Nuzhat Memon
 
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)Nuzhat Memon
 
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1 Basics Opera...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1  Basics Opera...Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1  Basics Opera...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1 Basics Opera...Nuzhat Memon
 
Std 11 Computer Chapter 4 Introduction to Layers (Part 3 Solving Textual Exe...
Std 11 Computer Chapter 4 Introduction to Layers  (Part 3 Solving Textual Exe...Std 11 Computer Chapter 4 Introduction to Layers  (Part 3 Solving Textual Exe...
Std 11 Computer Chapter 4 Introduction to Layers (Part 3 Solving Textual Exe...Nuzhat Memon
 
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...Nuzhat Memon
 
Std 11 Computer Chapter 4 Introduction to Layers
Std 11 Computer Chapter 4 Introduction to LayersStd 11 Computer Chapter 4 Introduction to Layers
Std 11 Computer Chapter 4 Introduction to LayersNuzhat Memon
 

More from Nuzhat Memon (20)

Std 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQsStd 10 chapter 11 data type, expression and operators important MCQs
Std 10 chapter 11 data type, expression and operators important MCQs
 
Std 10 Chapter 10 Introduction to C Language Important MCQs
Std 10 Chapter 10 Introduction to C Language Important MCQsStd 10 Chapter 10 Introduction to C Language Important MCQs
Std 10 Chapter 10 Introduction to C Language Important MCQs
 
Std 12 Computer Chapter 6 object oriented concept important mcqs
Std 12 Computer Chapter 6 object oriented concept important mcqsStd 12 Computer Chapter 6 object oriented concept important mcqs
Std 12 Computer Chapter 6 object oriented concept important mcqs
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)
 
Std 12 computer chapter 6 object oriented concepts (part 2)
Std 12 computer chapter 6 object oriented concepts (part 2)Std 12 computer chapter 6 object oriented concepts (part 2)
Std 12 computer chapter 6 object oriented concepts (part 2)
 
Std 12 computer java basics part 3 control structure
Std 12 computer java basics part 3 control structureStd 12 computer java basics part 3 control structure
Std 12 computer java basics part 3 control structure
 
Std 12 Computer Chapter 7 Java Basics (Part 2)
Std 12 Computer Chapter 7 Java Basics (Part 2)Std 12 Computer Chapter 7 Java Basics (Part 2)
Std 12 Computer Chapter 7 Java Basics (Part 2)
 
Std 12 Computer Chapter 7 Java Basics (Part 1)
Std 12 Computer Chapter 7 Java Basics (Part 1)Std 12 Computer Chapter 7 Java Basics (Part 1)
Std 12 Computer Chapter 7 Java Basics (Part 1)
 
Std 12 Computer Chapter 13 other useful free tools and services important MCQs
Std 12 Computer Chapter 13 other useful free tools and services important MCQsStd 12 Computer Chapter 13 other useful free tools and services important MCQs
Std 12 Computer Chapter 13 other useful free tools and services important MCQs
 
Std 12 Computer Chapter 9 Working with Array and String in Java important MCQs
Std 12 Computer Chapter 9 Working with Array and String in Java important MCQsStd 12 Computer Chapter 9 Working with Array and String in Java important MCQs
Std 12 Computer Chapter 9 Working with Array and String in Java important MCQs
 
Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)Std 12 computer chapter 8 classes and object in java (part 2)
Std 12 computer chapter 8 classes and object in java (part 2)
 
Std 10 computer chapter 10 introduction to c language (part2)
Std 10 computer chapter 10 introduction to c language (part2)Std 10 computer chapter 10 introduction to c language (part2)
Std 10 computer chapter 10 introduction to c language (part2)
 
Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)Std 10 computer chapter 10 introduction to c language (part1)
Std 10 computer chapter 10 introduction to c language (part1)
 
Std 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem SolvingStd 10 computer chapter 9 Problems and Problem Solving
Std 10 computer chapter 9 Problems and Problem Solving
 
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 3: Masking to R...
 
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)
Chapter 5 Using Pictures in Synfig (Practical 2: Masking to hide area in synfig)
 
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1 Basics Opera...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1  Basics Opera...Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1  Basics Opera...
Std 11 Computer Chapter 5 Using Pictures in Synfig (Practical 1 Basics Opera...
 
Std 11 Computer Chapter 4 Introduction to Layers (Part 3 Solving Textual Exe...
Std 11 Computer Chapter 4 Introduction to Layers  (Part 3 Solving Textual Exe...Std 11 Computer Chapter 4 Introduction to Layers  (Part 3 Solving Textual Exe...
Std 11 Computer Chapter 4 Introduction to Layers (Part 3 Solving Textual Exe...
 
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...
Std 11 Computer Chapter 4 Introduction to Layers (Part 2 Practical :Rotation ...
 
Std 11 Computer Chapter 4 Introduction to Layers
Std 11 Computer Chapter 4 Introduction to LayersStd 11 Computer Chapter 4 Introduction to Layers
Std 11 Computer Chapter 4 Introduction to Layers
 

Recently uploaded

IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 

Recently uploaded (20)

IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 

Std 12 computer chapter 8 classes and objects in java important MCQs

  • 1. CHAPTER 8 CLASSES AND OBJECTS IN JAVA Important MCQs
  • 2. Compiled by Nuzhat Memon 2 1. What do you mean by class? a) Data & program code b) Data & method c) Only data d) Only program code 2. Which of the following is the correct syntax for defining a class ? a) class [class name] { <variable><methods>} b) class <class name> {<variable> <methods>} c) class {class name} ( <variable> <methods> ) d) class (class name) { <variable> <method> }
  • 3. Compiled by Nuzhat Memon 3 3. In class, Data is referred to as____________ a) attributes b) behavior c) state d) None of these 4. In Java, functions referred to as __________ a) attributes b) behavior c) state d) None of these
  • 4. Compiled by Nuzhat Memon 4 5. In Java, by which component is the class generally made up of? a) Name, variable b) Behaviour , variable c) Name, attributes d) Attributes, behaviour 6. In java, which of the following defines attributes and methods? a) Class b) Object c) Instance d) Variable
  • 5. Compiled by Nuzhat Memon 5 7. ___________ is a template for multiple objects with similar features. a) Public b) Main c) Static d) Class 8. In Java, a class is defined using which keyword ? a) public b) main c) static d) class
  • 6. 6 9. What are defined by variables in a class ? a) Attribute b) Behaviour c) State d) Methods 10. What are defined by method in a class? a) Class b) State c) Attribute d) Behaviour
  • 7. 7 11. Which of the following is used to access or modify attributes? a) Class b) State c) Attribute d) Method 12. Variables belongs to a class and not to an ...... a) Object b) Attribute c) Behaviour d) Method
  • 8. Compiled by Nuzhat Memon 8 13. In Java, which operator allocates the memory for an object and returns the address of object? a) add b) class c) super d) new 14. What is the name of the data structure, where all instances of class are allocated memory? a) reference b) heap c) class d) variable
  • 9. Compiled by Nuzhat Memon 9 15. Variable of class type are also referred to as _______variables. a) Global b) Reference c) Allocated d) Constant 16.What do we call the address of the memory location where the object is stored? a) Reference b) Address c) Allocated d) Constant
  • 10. Compiled by Nuzhat Memon 10 17. Which steps are required to create an object from a class in java? a) declaration b) instantiation c) initialization d) all of these 18. In object oriented programming (OOP) language, creating an object is also known as what? a) object instantiation b) object creating c) object making d) none of these
  • 11. Compiled by Nuzhat Memon 11 19.In Java, which step of creating an object from a class initialize the newly created object ? a) Declaration b) Instantiation c) Initialization d) All of these 20. Java have a ..... that looks for unused objects and reclaims the memory that those objects are using. a) Unused collector b) Garbage collector c) Reclaim collector d) Memory collector
  • 12. Compiled by Nuzhat Memon 12 21. In Java class, in which step a ‘new’ keyword is used to create the object by allocating memory? a) Declaration b) Instantiation c) Initialization d) All of these 22. ____________ is special kind of method called to initialize the newly created object. a) classes b) reference variable c) syntax variable d) constructor
  • 13. Compiled by Nuzhat Memon 13 23. A variable declared using class type can only store what? a) store an object b) reference to an object c) classified an object d) interfere an object 24. In java, Which of the following is not a step of creating an object from a class? a) Declaration b) Instantiation c) Initialization d) Calculation
  • 14. Compiled by Nuzhat Memon 14 25. Which of the following is the correct syntax to declare and create an object in a single line ? a) Room r2=new Room( ); b) Room r1=room() c) Room r=room(); d) Room = Room(new); 26. When statement “r1= new Room( );” is executed then what is stored in r1? a) Heap b) Address of an object c) Reference of an object d) All of these
  • 15. Compiled by Nuzhat Memon 15 27. Declaring a variable does not create an ______ in java. a) Method b) Attribute c) Behaviour d) Object 28. When a program contains 2 or more classes, only one class can contain the _____________ method a) private b) class c) string() d) main()
  • 16. Compiled by Nuzhat Memon 16 29. Which of the following represents the type of variable ? a) Instance variables b) Local variables c) Class variables d) All of these 30. Variables defined inside methods or blocks are known as which type of variable ? a) Local variables b) Block variables c) Instance variables d) Class variables
  • 17. Compiled by Nuzhat Memon 17 31. Which type of variables is created at the time of creating an object and stay throughout the life of the objects? a) Local b) Instance c) Static d) Null 32. Which type of variable is define by the attributes of an object? a) Local b) Instance c) Static d) Null
  • 18. Compiled by Nuzhat Memon 18 33. Which is the correct syntax of accessing and calling instance variable? a) <object reference>.<instance variable or method> b) <instance variable or method>.<object reference> c) (object reference).(instance variable or method) d) None of these 34. Which of the following is used to invoke an instance method in java ? a) The name of the object, colon(:) and the name of the method. b) The name of the class, colon(:) and the name of the method. c) The name of the object, dot(.) and the name of the method. d) The name of the class, dot(.) and the name of the method.
  • 19. Compiled by Nuzhat Memon 19 35. From which of the following operators can we access instance variables and instance methods ? a) . ( dot) b) : ( colon) c) , ( comma) d) ; ( semi colon) 36. What is the associativity of . (dot) operator which is used to access instance variable ? a) Upper to Lower b) Right to Left c) Lower to Upper d) Left to Right
  • 20. Compiled by Nuzhat Memon 20 37. Which type of variables are defined within a class but outside any method? a) Class variables b) Block variables c) Instance variables d) Local variables 38. Which type of variables are defined within a class but outside any method with static keyword? a) Class variables b) Block variables c) Instance variables d) Local variables
  • 21. Compiled by Nuzhat Memon 21 39. Referring instance variable or invoking method with null reference will give _____ a) Output b) Object c) Class d) Error 40. Which variables are initialized with default value? a) class and local variables b) Instance and class variable c) class and static variable d) local and instance variable
  • 22. Compiled by Nuzhat Memon 22 41. ________ are created when the method or block is started and destroyed when the method or block has completed. a) Instance variable b) Class variable c) Local variable d) None of these 42. Which of the following method can be called without creating an instance of a class ? a) Instance method b) Class method c) Constructor method d) All of these
  • 23. Compiled by Nuzhat Memon 23 43. How do you identify the variable which is define with in a class, out-side any method with the static key word in Java ? a) Block variables b) Local variables c) Instance variables d) Class variables 44. Which of the following keyword is used to declare Class variables and class methods ? a) private b) static c) package d) public
  • 24. Compiled by Nuzhat Memon 24 45. Which of the following is accessible by instance methods ? a) Only class variables b) Only instance variables c) Both instance variables and class variables d) Constructor 46. Which of the following is accessible by class methods ? a) Only class variables b) Only instance variables c) Both instance variables and class variables d) Constructor
  • 25. Compiled by Nuzhat Memon 25 47. Constructor is invoked implicitly only when an object is constructed using ______ operator a) default b) new c) new() d) + 48. Constructor must have the _____ name as class name. a) New b) Same c) Different d) Default
  • 26. Compiled by Nuzhat Memon 26 49. In Java, which method is invoked automatically with creation of an object ? a) Instance method b) Class method c) Constructor d) None of these 50. Which of the following can perform any action, but it is mainly designed to perform initializing actions ? a) Consolidation b) Constructors c) Confirmation d) Contractor
  • 27. Compiled by Nuzhat Memon 27 51. Which constructor is called with empty parenthesis without arguments ? a) Default constructor b) Object constructor c) Method d) Parameterized constructor 52. Every class is having its default ......................... a) Inheritance b) Constructor c) Polymorphism d) All of these
  • 28. Compiled by Nuzhat Memon 28 53. In absence of user define constructor in a class, objects are constructed using which type of constructor ? a) No – argument b) Parameterized c) Multi level d) Default 54. Which of the following is known as a user – defined no – argument constructor ? a) <classname> () {}; b) <classname> () [ ]; c) <classname> () [ ]; d) <classname> [ ] ();
  • 29. Compiled by Nuzhat Memon 29 54. Which type of constructor does not take any argument ? a) Default b) Multiple c) Multi level d) Parameterized 55. Constructor does not have _______ type. a) void() b) Return c) Default d) All of these
  • 30. Compiled by Nuzhat Memon 30 56. Which of the following is the correct for the constructor ? i. Constructor must have the same name as class name. ii. Constructor does not have return type. iii. Constructor is invoked implicitly only when an object is constructed using new operator. iv. Constructor can not be invoked explicitly elsewhere in the program. v. Constructor can be invoked implicitly. a) i, ii, v, iii b) i, ii, iii, iv c) v, i, iv, iii d) v, i, iii, iv
  • 31. Compiled by Nuzhat Memon 31 57. Which word means “many forms”, different forms of method with same name in Java? a) Aggregation b) Polymorphism c) Composition d) None of these 58. Which of the following are the steps to create Polymorphism? a) Method name b) Type of return value c) A list of parameters d) All of these
  • 32. Compiled by Nuzhat Memon 32 59. In java, we can have different methods that have the same name but a different signature is also called as what ? a) overloading method b) Overridden method c) overloading class d) Overridden signature 60.When methods in superclass and subclass have same name and signature, what are they called? a) Overloaded methods b) overridden methods c) Inherited methods d) All of the above
  • 33. Compiled by Nuzhat Memon 33 61. What is known as visibility modifier ? a) Constructor b) Inheritance c) Polymorphism d) Access modifier 62. Access control means to control ........... a) Visibility b) Objects c) Program d) Attributes
  • 34. Compiled by Nuzhat Memon 34 63. In Java, how many levels of visibility modifiers are available for access control ? a) 5 b) 3 c) 4 d) 2 64. Which are the for P’s used in the four levels of visibility to provide necessary protection ? a) Process, Private, Protected, Public b) Public, Package, Protected, Process c) Public, Package, Protected, Private d) Private, Package, Protected, Public
  • 35. Compiled by Nuzhat Memon 35 65. Match the correct access modifier with its visibility a) 1- C, 2- A, 3- B, 4- D b) 1- C, 2- A, 3- D, 4- B Access modifier Visibility 1 Public A    2 Default: Package B Narrowest 3 Protected C Widest 4 private D  
  • 36. Compiled by Nuzhat Memon 36 66. Which is the default level of protection, where lack of any access modifier keyword is in a declaration in Java a) Private b) Package c) Public d) Protected 67. Which of the following is syntax of package ? a) Package {Package Name}; b) Package <Package Name>; c) Package (Package Name); d) Package [Package Name];
  • 37. Compiled by Nuzhat Memon 37 68. Which of the following access modifier is used to organized classes ? a) Public b) Package c) Private d) Protected 69. Which access modifier provides visibility to classes defined in the other package ? a) Package b) Public c) Private d) Protected
  • 38. Compiled by Nuzhat Memon 38 70. To provide public access, which keyword type before method or variable type? a) Private b) Public c) Protected d) Package 71. Public variables and methods are _______anywhere. a) Invisible b) Visible c) Outside d) Inside
  • 39. Compiled by Nuzhat Memon 39 72. If we want to make visible to all the classes outside the class, where method or variable is visible to class, which type of access modifier is used ? a) Public b) Package c) Protected d) Private 73. Highest level of protection can be achieved by using which protection level? a) Protected b) Package c) Public d) Private
  • 40. Compiled by Nuzhat Memon 40 74. __________ members are available as ‘private’ members in the inherited subclass. a) Public b) Package c) Protected d) Private 75. ____________ provides data encapsulation. a) Protected b) Package c) Public d) Private
  • 41. Compiled by Nuzhat Memon 41 76. Accessor method is known as what in Java ? a) set b) setter c) getter d) get 77. Mutator method is known as what in Java ? a) setter b) set c) get d) getter
  • 42. Compiled by Nuzhat Memon 42 78. If we want to allow other methods to read only the data value, then which method is used ? a) writer b) reader c) Getter d) Setter 79. If we want to allow other methods to modify the data value, then which method is used ? a) write b) getter c) reader d) Setter
  • 43. Compiled by Nuzhat Memon 43 80. In Java, if we want to allow protect data to be used by others, then which methods are to be written ? a) Get b) Mutator c) Accessor d) Set 81. In Java, if we want to allow protect data to be modified by others, then which methods are to be written ? a) Set b) Get c) Mutator d) Accessor
  • 44. Compiled by Nuzhat Memon 44 82. Which level of protection is used to allow the access only to sub classes or to share with the methods declared as “friend” in Java ? a) Package b) Private c) Public d) Protected 83.Which keyword is used to share data of private class? a) Extends b) Friend c) Throw d) Get
  • 45. Compiled by Nuzhat Memon 45 84. Which of the following allows us to build new class with added capabilities by extending existing class ? a) Polymorphism b) Composition c) Aggregation d) Inheritance 85. Inheritance establish which type of relationship between two classes in java ? a) is – a b) has – a c) have – a d) are – a
  • 46. Compiled by Nuzhat Memon 46 86. Inheritance model is based on which type of relationship between two classes ? a) Has – a – part b) Is – a – kind c) Is – a – kind – of d) Both b or c 87. In Java, which keyword is used to call the constructor of super class in the constructor of sub class ? a) class b) extends c) super d) sub
  • 47. Compiled by Nuzhat Memon 47 88. Which keyword is used to create a subclass in the class definition? a) class b) extends c) super d) Sub 89. What is not inherited in sub class? a) Constructor b) Method c) Polymorphism d) Super class
  • 48. Compiled by Nuzhat Memon 48 90. In Java, Parent class can be referred to as which of the following ? a) Sub class, Base class, Super class b) Parent class, Super class, Base class c) Sub class, Derived class, Extended class d) Parent class, Extended class, Base class 91. In Java, Child class can be referred to as which of the following ? a) Parent class, Extended class, Base class b) Sub class, Base class, Super class c) Parent class, Super class, Base class d) Sub class, Derived class, Extended class
  • 49. Compiled by Nuzhat Memon 49 92. In inheritance, Parent class is also referred to as ____class. a) Super b) Sub c) Base d) Both a and c 93. In Java, a Sub class can be derived from which class ? OR In Java, a Sub class inherits all instance variables and methods from which class ? a) Child class b) Owner class c) Extended class d) Super class
  • 50. Compiled by Nuzhat Memon 50 94. In which class common features are kept? a) Super class b) Extended class c) Sub class d) Derived class 95. Which class inherits all instance variables and methods from super class, and it may have its own added variables and methods? a) Base class b) Sub class c) Super class d) Parent class
  • 51. Compiled by Nuzhat Memon 51 96. Which symbol is used in Inheritance ? a) Triangle b) Diamond c) Circle d) arrow 97. Java does not support ......... type of inheritance . a) Single b) Multiple c) Multi level d) Constructor
  • 52. Compiled by Nuzhat Memon 52 98. Composition and Aggregation establish which type of relationship between classes in Java ? a) As – a b) Has – a c) Is – a d) Was – a 99. Composition and aggregation establish which type of relationship between classes? a) Has – a – part b) Has – a c) Is – a – kind – of d) Both a or b
  • 53. Thanks! Any questions? You can find me at @nuzhatmemon.com and nuzhat.memon@gmail.com 53