Questions · Page 4 of 10

MCQ

MCQ 1511 Mark
What will be given as referring instance variable or invoking method with null reference?
  • An error
  • B
    Status code
  • C
    Object code
  • D
    None of these
Answer
Correct option: A.
An error
An error
View full question & answer
MCQ 1521 Mark
Which of the following cannot be used legally?
  • A
    Null reference
  • B
    Null pointer
  • a Or b
  • D
    None of these
Answer
Correct option: C.
a Or b
a Or b
View full question & answer
MCQ 1531 Mark
What is the default initial value of reference variable which does not refer to any object?
  • null
  • B
    0
  • C
    /0
  • D
    —1
Answer
Correct option: A.
null
null
View full question & answer
MCQ 1541 Mark
Which operator is not needed to use when the instance variables are referred within the methods of the same class?
  • .
  • B
    ;
  • C
    new
  • D
    ,
Answer
Correct option: A.
.
.
View full question & answer
MCQ 1551 Mark
What is the associativity of dot operator?
  • A
    Right to Left
  • Left to Right
  • C
    Middle to Left
  • D
    Any of the sides
Answer
Correct option: B.
Left to Right
Left to Right
View full question & answer
MCQ 1561 Mark
From where and to which end does the associativity of dot operator move to?
  • A
    Right to Left
  • Left to Right
  • C
    Middle to Left
  • D
    Any of the sides
Answer
Correct option: B.
Left to Right
Left to Right
View full question & answer
MCQ 1571 Mark
How can we invoke display () method of Room r1?
  • r1. display 0
  • B
    r1. display 1
  • C
    r1; display 0
  • D
    _display
Answer
Correct option: A.
r1. display 0
r1. display 0
View full question & answer
MCQ 1581 Mark
How can we refer to length of Room r1 in a program?
  • A
    length. R1
  • r1. length
  • C
    r1; length
  • D
    _length
Answer
Correct option: B.
r1. length
r1. length
View full question & answer
MCQ 1591 Mark
By which of the following operator are instance variables and instance methods accessed?
  • A
    .
  • B
    new
  • C
    ;
  • (Dot Operator)
Answer
Correct option: D.
(Dot Operator)
(Dot Operator)
View full question & answer
MCQ 1601 Mark
By which of the following are Instance variables and Instance methods accessed?
  • Class
  • B
    Object
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
Class
Class
View full question & answer
MCQ 1611 Mark
Which of the following has its own set of data?
  • Each object instance
  • B
    Objects according to the class
  • C
    Object according to the method
  • D
    None of these
Answer
Correct option: A.
Each object instance
Each object instance
View full question & answer
MCQ 1621 Mark
Which of the following is an allocated memory in data structure called heap?
  • All instances of class
  • B
    All methods of class
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
All instances of class
All instances of class
View full question & answer
MCQ 1631 Mark
Which of the following is done by ‘new’ keyword?
  • A
    Objects are created.
  • B
    It returns a reference to an object that represents an instance of the class.
  • 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 1641 Mark
Which instance method has been defined in a class named Room in the textbook?
  • A
    setAttr0
  • B
    display 0
  • C
    area
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 1651 Mark
Which instance variables have been defined in a class named Room in the textbook?
  • A
    length
  • B
    width, height
  • C
    Windows
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 1661 Mark
What is known as to ask the object to perform some task in Java?
  • Invoking a method
  • B
    Removing a method
  • C
    Declaring a method
  • D
    Hiding a method
Answer
Correct option: A.
Invoking a method
Invoking a method
View full question & answer
MCQ 1671 Mark
Which is the method that can be invoked using the objects to access or modify the instance variable?
  • Instance method
  • B
    Subsidiary method
  • C
    Main method
  • D
    Index method
Answer
Correct option: A.
Instance method
Instance method
View full question & answer
MCQ 1681 Mark
By using which of the following ‘methods’ can be invoked?
  • Objects
  • B
    Class
  • C
    Function
  • D
    Script
Answer
Correct option: A.
Objects
Objects
View full question & answer
MCQ 1691 Mark
Where can methods be defined in Java?
  • A
    In subclass
  • Inside a class
  • C
    Outside of the class
  • D
    Is not possible
Answer
Correct option: B.
Inside a class
Inside a class
View full question & answer
MCQ 1701 Mark
Which of the following stores its own value for the attributes?
  • Instance
  • B
    Class
  • C
    Function
  • D
    Operator
Answer
Correct option: A.
Instance
Instance
View full question & answer
MCQ 1711 Mark
What does the class define?
  • kind of attributes
  • B
    Name of attributes
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
kind of attributes
kind of attributes
View full question & answer
MCQ 1721 Mark
What do instance variables define?
  • A
    Class of an object
  • Attributes of an object
  • C
    Method of an object
  • D
    Operator of an object
Answer
Correct option: B.
Attributes of an object
Attributes of an object
View full question & answer
MCQ 1731 Mark
Which variables stay throughout the life of the object?
  • Instance variable
  • B
    Class variable
  • C
    Object variable
  • D
    Garbage variable
Answer
Correct option: A.
Instance variable
Instance variable
View full question & answer
MCQ 1741 Mark
Which variables are created at the time of creating an object?
  • A
    Class variable
  • Instance variable
  • C
    Object variable
  • D
    Garbage variable
Answer
Correct option: B.
Instance variable
Instance variable
View full question & answer
MCQ 1751 Mark
Each instance of a class can hold different values for its attributes in variables declared in a class What such variables are referred as?
  • Instance variable
  • B
    Class variable
  • C
    Object variable
  • D
    Garbage variable
Answer
Correct option: A.
Instance variable
Instance variable
View full question & answer
MCQ 1761 Mark
Which type of values can each instance of a class hold?
  • Different
  • B
    Same
  • C
    More than one
  • D
    More than two
Answer
Correct option: A.
Different
Different
View full question & answer
MCQ 1771 Mark
Which type of values can each instance of a class hold for its attributes in the variable declared in a class?
  • Different
  • B
    Same
  • C
    More than one
  • D
    More than two
Answer
Correct option: A.
Different
Different
View full question & answer
MCQ 1781 Mark
Which terms are often interchangeably used in OOP language?
  • Instance and Object
  • B
    Object and Class
  • C
    Class and Method
  • D
    Instance and Method
Answer
Correct option: A.
Instance and Object
Instance and Object
View full question & answer
MCQ 1791 Mark
Which of the following is a concrete representation of an object?
  • Instance
  • B
    Class
  • C
    Method
  • D
    Function
Answer
Correct option: A.
Instance
Instance
View full question & answer
MCQ 1801 Mark
Which of the following is an abstract representation of an object?
  • Class
  • B
    Instance
  • C
    Method
  • D
    Function
Answer
Correct option: A.
Class
Class
View full question & answer
MCQ 1811 Mark
For what does an actual instance of a class stands as another word?
  • an actual object
  • B
    Method
  • C
    Function
  • D
    Operator
Answer
Correct option: A.
an actual object
an actual object
View full question & answer
MCQ 1821 Mark
What is said to be as an object that belongs to class?
  • Operator
  • B
    Functional
  • C
    Instance
  • D
    None of these
Answer
Correct option: A.
Operator
Operator
View full question & answer
MCQ 1831 Mark
What is created to store the data for the object by allocating memory?
  • A
    An instance for an object
  • B
    A form of an object
  • Type of an object
  • D
    None of these
Answer
Correct option: C.
Type of an object
Type of an object
View full question & answer
MCQ 1841 Mark
What is known as the process of creating an object in object oriented programming language?
  • A
    Object instantiation
  • a and b both
  • C
    Class instantiation
  • D
    None of these
Answer
Correct option: B.
a and b both
a and b both
View full question & answer
MCQ 1851 Mark
What is the full form of OOP?
  • Object Oriented Programming
  • B
    Open Object Programming
  • C
    Onscreen Object Programming
  • D
    Only Object Programming
Answer
Correct option: A.
Object Oriented Programming
Object Oriented Programming
View full question & answer
MCQ 1861 Mark
Which type of object does the garbage collector find?
  • A
    Used
  • Unused
  • C
    a and b both
  • D
    None of these
Answer
Correct option: B.
Unused
Unused
View full question & answer
MCQ 1871 Mark
Which of the following looks for unused objects and reclaims the memory?
  • Garbage collector
  • B
    Garbage object
  • C
    Garbage finder
  • D
    Garbage engine
Answer
Correct option: A.
Garbage collector
Garbage collector
View full question & answer
MCQ 1881 Mark
Which type of memory spaces are allocated to different objects to keep their data value in Java?
  • Different
  • B
    Same
  • C
    Separate according to the class
  • D
    Separate according to the method
Answer
Correct option: A.
Different
Different
View full question & answer
MCQ 1891 Mark
Which of the following has its own set of data?
  • Object
  • B
    Class
  • C
    Method
  • D
    Super classes
Answer
Correct option: A.
Object
Object
View full question & answer
MCQ 1901 Mark
Inside which of the following is the actual data not contained?
  • In the Class
  • B
    In the Object
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
In the Class
In the Class
View full question & answer
MCQ 1911 Mark
Inside which of the following is the actual data contained?
  • A
    In the Class
  • B
    In the Object
  • 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 1921 Mark
Which of the following determines only the types of the variable?
  • Class
  • B
    Object
  • C
    Operator
  • D
    Method
Answer
Correct option: A.
Class
Class
View full question & answer
MCQ 1931 Mark
Which statement can be written by combining statement Room r1; and r1 new Room0?
  • Room r1 = new Room 0;
  • B
    rlRoom0;
  • C
    Room r1 = new Room r2;
  • D
    None of these
Answer
Correct option: A.
Room r1 = new Room 0;
Room r1 = new Room 0;
View full question & answer
MCQ 1941 Mark
Which of the following statements states that object is not stored in variable rl, but variable ri1 contains the only address of an object?
  • r1=newRoom0;
  • B
    r1 = new Room0.
  • C
    r1=Room0;
  • D
    r1=Room;
Answer
Correct option: A.
r1=newRoom0;
r1=newRoom0;
View full question & answer
MCQ 1951 Mark
What do the parentheses with arguments determine while creating an object?
  • Initial value
  • B
    Middle value
  • C
    Ending value
  • D
    None of these
Answer
Correct option: A.
Initial value
Initial value
View full question & answer
MCQ 1961 Mark
What is called by some empty parentheses without arguments?
  • Default constructor
  • B
    None of these
  • C
    main0 method
  • D
    a and b both
Answer
Correct option: A.
Default constructor
Default constructor
View full question & answer
MCQ 1971 Mark
Which of the following is a statement to create an object of type Room and assign its address to variable r1?
  • r1 = new Room 0;
  • B
    r1=Room0;
  • C
    r1= = new Room 0;
  • D
    r1 Room
Answer
Correct option: A.
r1 = new Room 0;
r1 = new Room 0;
View full question & answer
MCQ 1981 Mark
Which special method is executed to perform initial task when an object is created in addition to allocating memory?
  • A
    main0
  • constructor
  • C
    a and b both
  • D
    Memory cart
Answer
Correct option: B.
constructor
constructor
View full question & answer
MCQ 2001 Mark
What is called a special portion of memory where the objects live?
  • Heap
  • B
    Memory board
  • C
    Object board
  • D
    Memory cart
Answer
Correct option: A.
Heap
Heap
View full question & answer
MCQ - Page 4 - COMPUTER STD 12 Science Questions - Vidyadip