MCQ 1011 MarkWhat is invoked implicitly only when an object is constructed using ‘new’ operator?A InstanceB Signature✓ ConstructorD None of theseAnswerCorrect option: C. ConstructorConstructorView full question & answer→
MCQ 1021 MarkWhich return type does the constructor have?A voidB - C int✓ There is no return typeAnswerCorrect option: D. There is no return typeThere is no return typeView full question & answer→
MCQ 1031 MarkConstructor must have name similar to the following one.✓ ClassB ObjectC MethodD None of theseAnswerCorrect option: A. ClassClassView full question & answer→
MCQ 1041 MarkWhich of the following initializes the attributes of newly created object using default values based on their data types?✓ Default constructorB Varies constructorC Constant constructorD None of theseAnswerCorrect option: A. Default constructorDefault constructorView full question & answer→
MCQ 1051 MarkWhich of the following does not take any argument?✓ Default constructorB Varies constructorC Constant constructorD None of theseAnswerCorrect option: A. Default constructorDefault constructorView full question & answer→
MCQ 1061 MarkDefault constructor is referred as following type of constructor.✓ Without argumentB With argumentC VariesD ConstantAnswerCorrect option: A. Without argumentWithout argumentView full question & answer→
MCQ 1071 MarkWhat is default for every class?✓ ConstructorB OperatorC ObjectD ReferenceAnswerCorrect option: A. ConstructorConstructorView full question & answer→
MCQ 1081 MarkWhich of the following is mainly designed to perform initializing actions?A main 0✓ constructorC getter 0D setter 0AnswerCorrect option: B. constructorconstructorView full question & answer→
MCQ 1091 MarkWhich of the following methods is invoked when a new object is created?✓ constructorB main 0C getter 0D setter 0AnswerCorrect option: A. constructorconstructorView full question & answer→
MCQ 1101 MarkThe method’s signature is a combination of the following one.A Method nameB A list of parametersC The type of return value✓ All of theseAnswerCorrect option: D. All of theseAll of theseView full question & answer→
MCQ 1111 MarkWhat is known as different methods with the same name but a different signature in Java?✓ Method overloadingB Method overridingC Duplicate methodD Repeated methodAnswerCorrect option: A. Method overloadingMethod overloadingView full question & answer→
MCQ 1121 MarkWhat is called as different methods with the same name?✓ PolymorphismB AggregationC InheritanceD EncapsulationAnswerCorrect option: A. PolymorphismPolymorphismView full question & answer→
MCQ 1131 MarkWhich of the following means “many forms”?✓ PolymorphismB InheritanceC AggregationD EncapsulationAnswerCorrect option: A. PolymorphismPolymorphismView full question & answer→
MCQ 1141 MarkWhich is the third step to create an object?A DeclarationB Function definitionC Instantiation✓ InitializationAnswerCorrect option: D. InitializationInitializationView full question & answer→
MCQ 1151 MarkWhich is the second step to create an object?✓ InstantiationB DeclarationC Function definitionD InitializationAnswerCorrect option: A. InstantiationInstantiationView full question & answer→
MCQ 1161 MarkWhich is the first step to create an object?✓ DeclarationB InstantiationC Function definitionD InitializationAnswerCorrect option: A. DeclarationDeclarationView full question & answer→
MCQ 1171 MarkWhich of the following variables are initialized with the default values?A ClassB InstanceC Local✓ a and b bothAnswerCorrect option: D. a and b botha and b bothView full question & answer→
MCQ 1181 MarkWhich variables are allocated memory only once per class and are shared by all its objects?✓ ClassB InstanceC LocalD None of theseAnswerCorrect option: A. ClassClassView full question & answer→
MCQ 1191 MarkWhich are the variables defined within a class, outside any method, with the static keyword?✓ ClassB LocalC InstanceD None of theseAnswerCorrect option: A. ClassClassView full question & answer→
MCQ 1201 MarkWhich variables are allocated memory from heap area when an object is instantiated?✓ InstanceB ClassC LocalD None of theseAnswerCorrect option: A. InstanceInstanceView full question & answer→
MCQ 1211 MarkWhich of the following variables are defined within a class but outside any method?✓ InstanceB LocalC ClassD None of theseAnswerCorrect option: A. InstanceInstanceView full question & answer→
MCQ 1221 MarkWhich of the following has formal parameters that are also local variables?✓ MethodB ClassC ObjectD None of theseAnswerCorrect option: A. MethodMethodView full question & answer→
MCQ 1231 MarkWhich of the following variables are not initialized by default values?✓ LocalB InstanceC Class-variableD All of theseAnswerCorrect option: A. LocalLocalView full question & answer→
MCQ 1241 MarkWhich of the following are created when the method or block is started and destroyed when the method or block is completed?✓ LocalB InstanceC Class-variableD All of theseAnswerCorrect option: A. LocalLocalView full question & answer→
MCQ 1251 MarkWhat are the variables defined inside methods or blocks called as?✓ LocalB InstanceC Class-variableD All of theseAnswerCorrect option: A. LocalLocalView full question & answer→
MCQ 1261 MarkWhich of the following variables can be seen in Java?A LocalB ClassC Instance✓ All of theseAnswerCorrect option: D. All of theseAll of theseView full question & answer→
MCQ 1271 MarkWhich of the following cannot be accessed from class methods?A Instance variableB Instance method✓ a and b bothD None of theseAnswerCorrect option: C. a and b botha and b bothView full question & answer→
MCQ 1281 MarkFrom where it is advisable to access class variables and class methods to increase their readability?✓ Class nameB Reference variableC a and b bothD None of theseAnswerCorrect option: A. Class nameClass nameView full question & answer→
MCQ 1291 MarkBy which of the following class variables and class methods can be accessed?A Class nameB Reference variableC Instance method✓ All of theseAnswerCorrect option: D. All of theseAll of theseView full question & answer→
MCQ 1301 MarkWhich definitions in the source code specify the things that will become part of every instance object belonging to a class?✓ non-staticB classC non-classD staticAnswerCorrect option: A. non-staticnon-staticView full question & answer→
MCQ 1311 MarkWhich definitions in the source code specify the things that are part of the class itself?✓ staticB non-staticC classD non-classAnswerCorrect option: A. staticstaticView full question & answer→
MCQ 1321 MarkWhich is the keyword used to declare main method?✓ staticB non-staticC classD non-classAnswerCorrect option: A. staticstaticView full question & answer→
MCQ 1331 MarkWhich type of method is main0?✓ ClassB InstanceC a and b bothD None of theseAnswerCorrect option: A. ClassClassView full question & answer→
MCQ 1341 MarkIn which class is the static method ‘sqrt’ shown (stored)?✓ MathB JavaC JMD Java MathAnswerCorrect option: A. MathMathView full question & answer→
MCQ 1351 MarkWhat have the designers of Java already provided with class method?✓ Built-in classB Built-in operatorC Built-in function’D All of theseAnswerCorrect option: A. Built-in classBuilt-in classView full question & answer→
MCQ 1361 MarkWhich is the method defined to provide some general utility but does not directly affect an instance of the class?✓ Class methodB Instance methodC New methodD Subclass methodAnswerCorrect option: A. Class methodClass methodView full question & answer→
MCQ 1371 MarkWhich is the method defined to operate on a particular object or affect that object?✓ Instance methodB Class methodC a and b bothD None of theseAnswerCorrect option: A. Instance methodInstance methodView full question & answer→
MCQ 1381 MarkWhich of the following method can be used anywhere regardless of whether an instance of the class exists or not?✓ Class methodB Instance methodC Accessory methodD Mutator methodAnswerCorrect option: A. Class methodClass methodView full question & answer→
MCQ 1391 MarkWhich of the following method is available to any other classes or objects?✓ Class methodB Instance methodC Accessory methodD Mutator methodAnswerCorrect option: A. Class methodClass methodView full question & answer→
MCQ 1401 MarkHow are the class methods to the class itself?✓ GlobalB LocalC PublicD PrivateAnswerCorrect option: A. GlobalGlobalView full question & answer→
MCQ 1411 MarkWhich is the keyword used in front of the method definition to define class methods?✓ staticB classC extendsD newAnswerCorrect option: A. staticstaticView full question & answer→
MCQ 1421 MarkWhich of the following variables can be accessed without creating an instance of a class?A GlobalB Dynamic✓ StaticD All of theseAnswerCorrect option: C. StaticStaticView full question & answer→
MCQ 1431 MarkWhich of the following is a statement to declare class variable tot Window in class with instance variables?✓ static int tot Windows;B class int tot Windows;C a Or bD None of theseAnswerCorrect option: A. static int tot Windows;static int tot Windows;View full question & answer→
MCQ 1441 MarkIn which of the following are values of class variables stored?✓ In the class itselfB In the instanceC a and b bothD None of theseAnswerCorrect option: A. In the class itselfIn the class itselfView full question & answer→
MCQ 1451 MarkIn which of the following are values of instance variables stored?A In the class✓ In the instance (memory allocated for the object)C a and b bothD None of theseAnswerCorrect option: B. In the instance (memory allocated for the object)In the instance (memory allocated for the object)View full question & answer→
MCQ 1461 MarkWhich keyword is used to declare class variables or static variables?A new✓ staticC extendsD classAnswerCorrect option: B. staticstaticView full question & answer→
MCQ 1471 MarkWhat are the variables known as which are declared within a class using static keyword before data type?A Static variableB Class variable✓ a Or bD None of theseAnswerCorrect option: C. a Or ba Or bView full question & answer→
MCQ 1481 MarkShow to which of the following one the variables do not belong to?✓ ObjectB ClassC MethodD FunctionAnswerCorrect option: A. ObjectObjectView full question & answer→
MCQ 1491 MarkTo which of the following one does a variable belong to?A ObjectB Method✓ ClassD FunctionAnswerCorrect option: C. ClassClassView full question & answer→
MCQ 1501 MarkWhen there is a need to have some variable that is shared by all object instances of the same class, the variable should be allocated memory only once per class. What is known as these types of variables?A class variableB static variable✓ a and b bothD None of theseAnswerCorrect option: C. a and b botha and b bothView full question & answer→