MCQ 11 MarkWhich of the following arrow, points from subclass towards superclass?✓ ←B →C ↔D ↕AnswerCorrect option: A. ←←View full question & answer→
MCQ 21 MarkWho enables creating classes as composition and aggregation of objects?✓ Use of object as an instance variable in classB Use of -object as static variable in classC a and b bothD None of theseAnswerCorrect option: A. Use of object as an instance variable in classUse of object as an instance variable in classView full question & answer→
MCQ 31 MarkWhat is advisable to be used as “public” for protection purpose?A Private instance variablesB ‘getter’ and ‘setter’ methods✓ a and b bothD None of theseAnswerCorrect option: C. a and b botha and b bothView full question & answer→
MCQ 41 MarkSpecify the purpose of access modifiers.✓ To determine visibility of instance membersB To determine the data type of instance membersC a and b bothD None of theseAnswerCorrect option: A. To determine visibility of instance membersTo determine visibility of instance membersView full question & answer→
MCQ 51 MarkWhich members of the class are shared by all objects of the class?✓Static membersB Private membersC a and b bothD None of theseAnswerCorrect option: A. Static membersStatic membersView full question & answer→
MCQ 61 MarkHow many times are static members allocated memory per class?✓ Only onceB TwiceC Not possibleD None of theseAnswerCorrect option: A. Only onceOnly onceView full question & answer→
MCQ 71 MarkWhich keyword is used to define class-variable and method?AclassBnewCsuper✓staticAnswerCorrect option: D. staticstaticView full question & answer→
MCQ 81 MarkWhich of the following variables belong to each object?✓ InstanceB MethodC ClassD None of theseAnswerCorrect option: A. InstanceInstanceView full question & answer→
MCQ 91 MarkWhat is called implicitly when an object is instantiated using ‘new’ operator?A main0✓ ConstructorC Access orD MutatorAnswerCorrect option: B. ConstructorConstructorView full question & answer→
MCQ 101 MarkWhich of the following is the special method with the same name as class name with no argument and no return type?A main0✓ ConstructorC Access orD MutatorAnswerCorrect option: B. ConstructorConstructorView full question & answer→
MCQ 111 MarkBecause of which type of relationship between ‘Library’ and ‘Room’, ‘Library’ class is not inherited from ‘Room’ class?✓ ‘has - a’B ‘is-a’C ‘is - not - a’D None of theseAnswerCorrect option: A. ‘has - a’‘has - a’View full question & answer→
MCQ 121 MarkIf we define class ‘Library’, it has a reading room, then which type of relationship exists between ‘Library’ and ‘Room’?✓ ‘has - a’B ‘is-a’C ‘is-not-a’D None of theseAnswerCorrect option: A. ‘has - a’‘has - a’View full question & answer→
MCQ 131 MarkWhich kind of relationship exists between ‘Library’ and ‘Room’?✓ ‘has - a’B ‘is-a’C ‘is - not - a’D None of theseAnswerCorrect option: A. ‘has - a’‘has - a’View full question & answer→
MCQ 141 MarkWhat a class is referred as when a class includes objects of other class?A SubB Super✓ ContainerD ParentAnswerCorrect option: C. ContainerContainerView full question & answer→
MCQ 151 MarkWhich of the following shows “has-a” relationship?✓ Library → Reading room (an object of Room class)B Class room 1 and Class room2C a and b bothD None of theseAnswerCorrect option: A. Library → Reading room (an object of Room class)Library → Reading room (an object of Room class)View full question & answer→
MCQ 161 MarkWhich relationship do composition and aggregation establish between classes?A ‘is - a’✓ ‘has - a’C ‘is - not - a’D None of theseAnswerCorrect option: B. ‘has - a’‘has - a’View full question & answer→
MCQ 171 MarkWhich of the following is a construction of classes that incorporates other object?A CompositionB AggregationC Polymorphism✓ a and b bothAnswerCorrect option: D. a and b botha and b bothView full question & answer→
MCQ 181 MarkHow many super classes are needed to derive a subclass?✓ Only oneB TwoC FiveD ManyAnswerCorrect option: A. Only oneOnly oneView full question & answer→
MCQ 191 MarkWhich kind of inheritance does Java not support?✓ MultilevelB NestedC Single levelD None of theseAnswerCorrect option: A. MultilevelMultilevelView full question & answer→
MCQ 201 Mark‘protected’ members are available as the following type of members in the inherited subclass.A public✓ privateC packageD None of theseAnswerCorrect option: B. privateprivateView full question & answer→
MCQ 211 MarkWhich method is used to make private members available elsewhere?A getterB setter✓ a and b bothD None of theseAnswerCorrect option: C. a and b botha and b bothView full question & answer→
MCQ 221 MarkWhich of the following members are directly available in the class in which they are defined?✓ privateB protectedC packageD publicAnswerCorrect option: A. privateprivateView full question & answer→
MCQ 231 MarkInstances having which of the following visibility are available for direct use in the entire package?A protectedB private✓ packageD publicAnswerCorrect option: C. packagepackageView full question & answer→
MCQ 241 MarkWhich of the following syntax is used for not overriding the method in the subclass when superclass and subclass have methods with the same signature?A _method name✓ super, method nameC super. method nameD None of theseAnswerCorrect option: B. super, method namesuper, method nameView full question & answer→
MCQ 251 MarkWhich method is said to be overridden in the subclass when superclass and subclass have methods with the same signature?✓ SuperclassB ChildC ExtendedD a and b bothAnswerCorrect option: A. SuperclassSuperclassView full question & answer→
MCQ 261 MarkWhich class is not a subset of superclass?✓ SubB ParentC MasterD IndexAnswerCorrect option: A. SubSubView full question & answer→
MCQ 271 MarkWhich keyword is used to call the constructor of superclass in the constructor of subclass?✓ superB newC classD extendsAnswerCorrect option: A. supersuperView full question & answer→
MCQ 281 MarkWhich keyword is used to create a subclass in the class definition?✓ extendsB SCC subD subclassAnswerCorrect option: A. extendsextendsView full question & answer→
MCQ 291 MarkWhich is the class that usually contains more information and methods than its superclass?✓ SubB ParentC MasterD IndexAnswerCorrect option: A. SubSubView full question & answer→
MCQ 301 MarkWhat is inherited in a subclass?A ConstructorB MethodC Instance variable✓ b and c bothAnswerCorrect option: D. b and c bothb and c bothView full question & answer→
MCQ 311 MarkWhat is not inherited in a subclass?✓ ConstructorB MethodC Instance variableD All of theseAnswerCorrect option: A. ConstructorConstructorView full question & answer→
MCQ 321 MarkWhich of the following variables and methods does a subclass contain?A Inherited from superclassB Its own added.✓ a and b bothD None of theseAnswerCorrect option: C. a and b botha and b bothView full question & answer→
MCQ 331 MarkWhich of the following does a subclass inherit from the superclass?A All instance variablesB Methods✓ a and b bothD None of theseAnswerCorrect option: C. a and b botha and b bothView full question & answer→
MCQ 341 MarkTo which of the following classes are common features kept?✓ SuperB SubC ChildD ExtendedAnswerCorrect option: A. SuperSuperView full question & answer→
MCQ 351 MarkWhich type of class is child class known as?A subB Extended✓ a and b bothD ParentAnswerCorrect option: C. a and b botha and b bothView full question & answer→
MCQ 361 MarkWhich type of class is parent class known as?A SuperB Base✓ a and b bothD ChildAnswerCorrect option: C. a and b botha and b bothView full question & answer→
MCQ 371 MarkClassroom is a Room and student is a Person. Here, which type of class is called ‘Room’ and ‘Person’ as well?A SubclassB Extended classC a and b both✓ Parent classAnswerCorrect option: D. Parent classParent classView full question & answer→
MCQ 381 MarkWhich of the following allows us to build new class with added capabilities by extending existing class?✓ InheritanceB PolymorphismC EncapsulationD AggregationAnswerCorrect option: A. InheritanceInheritanceView full question & answer→
MCQ 391 MarkUsing which of the following, object-oriented programming languages provide reusability feature?✓ InheritanceB PolymorphismC EncapsulationD AggregationAnswerCorrect option: A. InheritanceInheritanceView full question & answer→
MCQ 401 MarkWhich type of relationship does inheritance have between two classes?A ‘has - a’✓ ‘is - a’C ‘is-not - a’D None of theseAnswerCorrect option: B. ‘is - a’‘is - a’View full question & answer→
MCQ 411 MarkWhich parameters are not affecting actual parameters on making changes to them?✓ FormalB MinorC PrimitiveD None of theseAnswerCorrect option: A. FormalFormalView full question & answer→
MCQ 421 MarkThe values of which of the following parameters are copied to formal parameters and then function is executed?A Primitive✓ ActualC MinorD None of theseAnswerCorrect option: B. ActualActualView full question & answer→
MCQ 431 MarkWhich of the following variables can be passed as parameters?✓ PrimitiveB ActualC FormalD None of theseAnswerCorrect option: A. PrimitivePrimitiveView full question & answer→
MCQ 441 MarkWhile using access or and mutator method, it is a must to write ‘get’ and ‘set’ method for the following one only.A For each class✓ For each instance variableC For each integer objectD None of theseAnswerCorrect option: B. For each instance variableFor each instance variableView full question & answer→
MCQ 451 MarkWhich of the following minor inconvenience will reward us with an ease of reusability and maintenance?✓ Use of access or and mutator methodB Use of constructorC Use of main0 methodD None of theseAnswerCorrect option: A. Use of access or and mutator methodUse of access or and mutator methodView full question & answer→
MCQ 461 MarkWhich of the following method seems little difficult to write?✓ Use of access or and mutator methodB Use of constructorC Use of main0 methodD None of theseAnswerCorrect option: A. Use of access or and mutator methodUse of access or and mutator methodView full question & answer→
MCQ 471 MarkUse of which of the following methods will prevent the variables from getting directly accessed and modified by other users of the class?✓ Use of access or and mutator methodB Use of constructorC Use of main0 methodD None of theseAnswerCorrect option: A. Use of access or and mutator methodUse of access or and mutator methodView full question & answer→
MCQ 481 MarkWhich of the following is an example of “getter” method (Access or method)?✓get Length 0BGet Length 0Cget length 1Dset Length 0AnswerCorrect option: A. get Length 0get Length 0View full question & answer→
MCQ 491 MarkWhat is mutator method also known as?✓ setterB getterC modifierD verifierAnswerCorrect option: A. settersetterView full question & answer→
MCQ 501 MarkWhat is access or method also known as?✓ getterB setterC modifierD verifierAnswerCorrect option: A. gettergetterView full question & answer→