Questions · Page 3 of 10

MCQ

MCQ 1011 Mark
What is invoked implicitly only when an object is constructed using ‘new’ operator?
  • A
    Instance
  • B
    Signature
  • Constructor
  • D
    None of these
Answer
Correct option: C.
Constructor
Constructor
View full question & answer
MCQ 1021 Mark
Which return type does the constructor have?
  • A
    void
  • B
    -
  • C
    int
  • There is no return type
Answer
Correct option: D.
There is no return type
There is no return type
View full question & answer
MCQ 1031 Mark
Constructor must have name similar to the following one.
  • Class
  • B
    Object
  • C
    Method
  • D
    None of these
Answer
Correct option: A.
Class
Class
View full question & answer
MCQ 1041 Mark
Which of the following initializes the attributes of newly created object using default values based on their data types?
  • Default constructor
  • B
    Varies constructor
  • C
    Constant constructor
  • D
    None of these
Answer
Correct option: A.
Default constructor
Default constructor
View full question & answer
MCQ 1051 Mark
Which of the following does not take any argument?
  • Default constructor
  • B
    Varies constructor
  • C
    Constant constructor
  • D
    None of these
Answer
Correct option: A.
Default constructor
Default constructor
View full question & answer
MCQ 1061 Mark
Default constructor is referred as following type of constructor.
  • Without argument
  • B
    With argument
  • C
    Varies
  • D
    Constant
Answer
Correct option: A.
Without argument
Without argument
View full question & answer
MCQ 1071 Mark
What is default for every class?
  • Constructor
  • B
    Operator
  • C
    Object
  • D
    Reference
Answer
Correct option: A.
Constructor
Constructor
View full question & answer
MCQ 1081 Mark
Which of the following is mainly designed to perform initializing actions?
  • A
    main 0
  • constructor
  • C
    getter 0
  • D
    setter 0
Answer
Correct option: B.
constructor
constructor
View full question & answer
MCQ 1091 Mark
Which of the following methods is invoked when a new object is created?
  • constructor
  • B
    main 0
  • C
    getter 0
  • D
    setter 0
Answer
Correct option: A.
constructor
constructor
View full question & answer
MCQ 1101 Mark
The method’s signature is a combination of the following one.
  • A
    Method name
  • B
    A list of parameters
  • C
    The type of return value
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 1111 Mark
What is known as different methods with the same name but a different signature in Java?
  • Method overloading
  • B
    Method overriding
  • C
    Duplicate method
  • D
    Repeated method
Answer
Correct option: A.
Method overloading
Method overloading
View full question & answer
MCQ 1121 Mark
What is called as different methods with the same name?
  • Polymorphism
  • B
    Aggregation
  • C
    Inheritance
  • D
    Encapsulation
Answer
Correct option: A.
Polymorphism
Polymorphism
View full question & answer
MCQ 1131 Mark
Which of the following means “many forms”?
  • Polymorphism
  • B
    Inheritance
  • C
    Aggregation
  • D
    Encapsulation
Answer
Correct option: A.
Polymorphism
Polymorphism
View full question & answer
MCQ 1141 Mark
Which is the third step to create an object?
  • A
    Declaration
  • B
    Function definition
  • C
    Instantiation
  • Initialization
Answer
Correct option: D.
Initialization
Initialization
View full question & answer
MCQ 1151 Mark
Which is the second step to create an object?
  • Instantiation
  • B
    Declaration
  • C
    Function definition
  • D
    Initialization
Answer
Correct option: A.
Instantiation
Instantiation
View full question & answer
MCQ 1161 Mark
Which is the first step to create an object?
  • Declaration
  • B
    Instantiation
  • C
    Function definition
  • D
    Initialization
Answer
Correct option: A.
Declaration
Declaration
View full question & answer
MCQ 1171 Mark
Which of the following variables are initialized with the default values?
  • A
    Class
  • B
    Instance
  • C
    Local
  • a and b both
Answer
Correct option: D.
a and b both
a and b both
View full question & answer
MCQ 1181 Mark
Which variables are allocated memory only once per class and are shared by all its objects?
  • Class
  • B
    Instance
  • C
    Local
  • D
    None of these
Answer
Correct option: A.
Class
Class
View full question & answer
MCQ 1191 Mark
Which are the variables defined within a class, outside any method, with the static keyword?
  • Class
  • B
    Local
  • C
    Instance
  • D
    None of these
Answer
Correct option: A.
Class
Class
View full question & answer
MCQ 1201 Mark
Which variables are allocated memory from heap area when an object is instantiated?
  • Instance
  • B
    Class
  • C
    Local
  • D
    None of these
Answer
Correct option: A.
Instance
Instance
View full question & answer
MCQ 1211 Mark
Which of the following variables are defined within a class but outside any method?
  • Instance
  • B
    Local
  • C
    Class
  • D
    None of these
Answer
Correct option: A.
Instance
Instance
View full question & answer
MCQ 1221 Mark
Which of the following has formal parameters that are also local variables?
  • Method
  • B
    Class
  • C
    Object
  • D
    None of these
Answer
Correct option: A.
Method
Method
View full question & answer
MCQ 1231 Mark
Which of the following variables are not initialized by default values?
  • Local
  • B
    Instance
  • C
    Class-variable
  • D
    All of these
Answer
Correct option: A.
Local
Local
View full question & answer
MCQ 1241 Mark
Which of the following are created when the method or block is started and destroyed when the method or block is completed?
  • Local
  • B
    Instance
  • C
    Class-variable
  • D
    All of these
Answer
Correct option: A.
Local
Local
View full question & answer
MCQ 1251 Mark
What are the variables defined inside methods or blocks called as?
  • Local
  • B
    Instance
  • C
    Class-variable
  • D
    All of these
Answer
Correct option: A.
Local
Local
View full question & answer
MCQ 1261 Mark
Which of the following variables can be seen in Java?
  • A
    Local
  • B
    Class
  • C
    Instance
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 1271 Mark
Which of the following cannot be accessed from class methods?
  • A
    Instance variable
  • B
    Instance method
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ 1281 Mark
From where it is advisable to access class variables and class methods to increase their readability?
  • Class name
  • B
    Reference variable
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
Class name
Class name
View full question & answer
MCQ 1291 Mark
By which of the following class variables and class methods can be accessed?
  • A
    Class name
  • B
    Reference variable
  • C
    Instance method
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 1301 Mark
Which definitions in the source code specify the things that will become part of every instance object belonging to a class?
  • non-static
  • B
    class
  • C
    non-class
  • D
    static
Answer
Correct option: A.
non-static
non-static
View full question & answer
MCQ 1311 Mark
Which definitions in the source code specify the things that are part of the class itself?
  • static
  • B
    non-static
  • C
    class
  • D
    non-class
Answer
Correct option: A.
static
static
View full question & answer
MCQ 1321 Mark
Which is the keyword used to declare main method?
  • static
  • B
    non-static
  • C
    class
  • D
    non-class
Answer
Correct option: A.
static
static
View full question & answer
MCQ 1331 Mark
Which type of method is main0?
  • Class
  • B
    Instance
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
Class
Class
View full question & answer
MCQ 1341 Mark
In which class is the static method ‘sqrt’ shown (stored)?
  • Math
  • B
    Java
  • C
    JM
  • D
    Java Math
Answer
Correct option: A.
Math
Math
View full question & answer
MCQ 1351 Mark
What have the designers of Java already provided with class method?
  • Built-in class
  • B
    Built-in operator
  • C
    Built-in function’
  • D
    All of these
Answer
Correct option: A.
Built-in class
Built-in class
View full question & answer
MCQ 1361 Mark
Which is the method defined to provide some general utility but does not directly affect an instance of the class?
  • Class method
  • B
    Instance method
  • C
    New method
  • D
    Subclass method
Answer
Correct option: A.
Class method
Class method
View full question & answer
MCQ 1371 Mark
Which is the method defined to operate on a particular object or affect that object?
  • Instance method
  • B
    Class method
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
Instance method
Instance method
View full question & answer
MCQ 1381 Mark
Which of the following method can be used anywhere regardless of whether an instance of the class exists or not?
  • Class method
  • B
    Instance method
  • C
    Accessory method
  • D
    Mutator method
Answer
Correct option: A.
Class method
Class method
View full question & answer
MCQ 1391 Mark
Which of the following method is available to any other classes or objects?
  • Class method
  • B
    Instance method
  • C
    Accessory method
  • D
    Mutator method
Answer
Correct option: A.
Class method
Class method
View full question & answer
MCQ 1401 Mark
How are the class methods to the class itself?
  • Global
  • B
    Local
  • C
    Public
  • D
    Private
Answer
Correct option: A.
Global
Global
View full question & answer
MCQ 1411 Mark
Which is the keyword used in front of the method definition to define class methods?
  • static
  • B
    class
  • C
    extends
  • D
    new
Answer
Correct option: A.
static
static
View full question & answer
MCQ 1421 Mark
Which of the following variables can be accessed without creating an instance of a class?
  • A
    Global
  • B
    Dynamic
  • Static
  • D
    All of these
Answer
Correct option: C.
Static
Static
View full question & answer
MCQ 1431 Mark
Which 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 b
  • D
    None of these
Answer
Correct option: A.
static int tot Windows;
static int tot Windows;
View full question & answer
MCQ 1441 Mark
In which of the following are values of class variables stored?
  • In the class itself
  • B
    In the instance
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
In the class itself
In the class itself
View full question & answer
MCQ 1451 Mark
In 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 both
  • D
    None of these
Answer
Correct option: B.
In the instance (memory allocated for the object)
In the instance (memory allocated for the object)
View full question & answer
MCQ 1461 Mark
Which keyword is used to declare class variables or static variables?
  • A
    new
  • static
  • C
    extends
  • D
    class
Answer
Correct option: B.
static
static
View full question & answer
MCQ 1471 Mark
What are the variables known as which are declared within a class using static keyword before data type?
  • A
    Static variable
  • B
    Class variable
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 1481 Mark
Show to which of the following one the variables do not belong to?
  • Object
  • B
    Class
  • C
    Method
  • D
    Function
Answer
Correct option: A.
Object
Object
View full question & answer
MCQ 1491 Mark
To which of the following one does a variable belong to?
  • A
    Object
  • B
    Method
  • Class
  • D
    Function
Answer
Correct option: C.
Class
Class
View full question & answer
MCQ 1501 Mark
When 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 variable
  • B
    static variable
  • a and b both
  • D
    None of these
Answer
Correct option: C.
a and b both
a and b both
View full question & answer
MCQ - Page 3 - COMPUTER STD 12 Science Questions - Vidyadip