CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set B

CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set C with answers available in Pdf for free download. The MCQ Questions for Class 12 Computer Science with answers have been prepared as per the latest syllabus, NCERT books and examination pattern suggested in Standard 12 by CBSE, NCERT and KVS. Multiple Choice Questions are an important part of exams for Grade 12 Computer Science and if practiced properly can help you to get higher marks. Refer to more Chapter-wise MCQs for NCERT Class 12 Computer Science and also download more latest study material for all subjects

Classes and Objects In Java Class 12 Computer Science MCQ

Class 12 Computer Science students should refer to the following multiple-choice questions with answers for Classes and Objects In Java in standard 12. These MCQ questions with answers for Grade 12 Computer Science will come in exams and help you to score good marks

Classes and Objects In Java MCQ Questions with Answers

Question: Variable of class type are also referred to as________variables.

  • a) Orientation
  • b) Position
  • c) Reference
  • d) Indication

Answer: Reference


Question: Using________keyword, an object can be created.

  • a) Int
  • b) Float
  • c) New
  • d) Real

Answer: New


Question: Operator________allocates the memory for an object and returns the address of the object for later use.

  • a) Int
  • b) Float
  • c) New
  • d) Real

Answer: New

 

Question: _________is the address of the memory location where the object is stored. 

  • a) Memory
  • b) Variable
  • c) Reference
  • d) None of these

Answer: Reference


Question: There is a special portion of memory called the______where the objects live.

  • a) Heap
  • b) Pile
  • c) Stack
  • d) All of these

Answer: Heap


Question: When an object is created, in addition to allocating memory, a special method called_______is executed to perform initial task.

  • a) Function
  • b) Constructor
  • c) Class
  • d) Method

Answer: Constructor


Question: An object can be created of type Room and assign its address to variable rl as_______

  • a) rl = new Room();
  • b) rl = Room() new;
  • c) rl = Class Room();
  • d) None of these

Answer: rl = new Room();


Question: With empty parentheses without arguments, a default______is called.

  • a) Function
  • b) Constructor
  • c) Class
  • d) Method

Answer: Constructor


Question: A______initializes the attributes (variables) of the object using default values.

  • a) Function
  • b) Constructor
  • c) Class
  • d) Method

Answer: Constructor


Question: The______can contain arguments that determine the initial values of variables.

  • a) Room
  • b) Brackets
  • c) Parentheses
  • d) Class

Answer: Parentheses


Question: Observe the following Room r2 = new RoomO : - Variable r2 contains a______or address of memory location where a new object is created.

  • a) Memory
  • b) Variable
  • c) Reference
  • d) None of these

Answer: Reference


Question: The class determines only the_______of the variables.

  • a) Types
  • b) Collection
  • c) Location
  • d) Set

Answer: Types


Question: The actual________is contained inside the individual objects and not in the class.

  • a) Information
  • b) Data
  • c) Collection
  • d) Variables

Answer: Data


Question: Every______has its own set of data.

  • a) Class
  • b) Variable
  • c) Operator
  • d) Object

Answer: Object


Question: _______allocated different memory space to hold their data values.

  • a) Classes
  • b) Variables
  • c) Operators
  • d) Objects

Answer: Objects


Question: In Java, when______are no more needed, the memory is claimed back for reuse.

  • a) Classes
  • b) Variables
  • c) Operators
  • d) Objects

Answer: Objects


Question: Java has a garbage collector that looks for unused______and reclaims the memory that those objects are using.

  • a) Objects
  • b) Variables
  • c) Cells
  • d) Memory spaces

Answer: Objects


Question: In Java, there is no requirement to do any explicit freeing of______

  • a) Cells
  • b) Variables
  • c) Memory
  • d) Class

Answer: Memory


Question: In Object-oriented programming (OOP) languages, creating an object is also called______instantiation.

  • a) Class
  • b) Object
  • c) Inheritance
  • d) Polymorphism

Answer: Object


Question: An______for an object is created by allocating memory to store data for that object.

  • a) Instance
  • b) Example
  • c) Illustration
  • d) None of these

Answer: Instance

 

Question: An object that belongs to a_____is said to be an instance of that class.

  • a) Cells
  • b) Variables
  • c) Memory
  • d) Class

Answer: Class


Question: An________of a class is another word for an actual object.

  • a) Instance
  • b) Example
  • c) Memory
  • d) None of these

Answer: Instance


Question: _______is an abstract representation of an object, whereas an instance is its concrete representation.

  • a) Cells
  • b) Variables
  • c) Memory
  • d) Class

Answer: Class


Question: The terms instance and object are often used interchangeably in______languages.

  • a) Programming
  • b) OOP
  • c) All
  • d) None of these

Answer: OOP


Question: Each______of a class can hold different values for its attributes in variables declared in a class.

  • a) Instance
  • b) Example
  • c) Illustration
  • d) None of these

Answer: Instance


Question: ______variables are created at the time of creating an object and stay throughout the life of the object.

  • a) Program
  • b) Instance
  • c) Inherited
  • d) Duplicate

Answer: Instance


Question: ______variables define the attributes of an object.

  • a) Program
  • b) Instance
  • c) Inherited
  • d) Duplicate

Answer: Instance


Question: The______defines the kind of attribute.

  • a) Program
  • b) Variables
  • c) Property
  • d) Class

Answer: Class


Question: Each_____stores its own value for that attributes.

  • a) Program
  • b) Instance
  • c) Inherited
  • d) Duplicate

Answer: Instance


Question: To define an object's behaviour_______are created.

  • a) Instances
  • b) Programs
  • c) Methods
  • d) Functions

Answer: Methods

 

Question: In Java_____can be defined inside a class only.

  • a) Instances
  • b) Programs
  • c) Methods
  • d) Functions

Answer: Methods


Question: The_______can be invoked using the objects to access or modify the instance variables.

  • a) Instances
  • b) Programs
  • c) Methods
  • d) Functions

Answer: Methods


Question: The____invoked using the objects are known as instance methods.

  • a) Instances
  • b) Programs
  • c) Methods
  • d) Functions

Answer: Methods


Question: ______methods are used to define behaviour of an object.

  • a) Program
  • b) Instance
  • c) Inherited
  • d) Duplicate

Answer: Instance


Question: Invoking a______is to ask the object to perform some task.

  • a) Instance
  • b) Program
  • c) Method
  • d) Function

Answer: Method


Question: Objects are created with the_____keyword.

  • a) new
  • b) New
  • c) NEW
  • d) nEW

Answer: new


Question: The______keyword returns a reference to an object that represents an instance of the class.

  • a) new
  • b) New
  • c) NEW
  • d) nEW

Answer: new


Question: All instances of class are allocated memory in data structure called_______

  • a) Pile
  • b) Heap
  • c) Mound
  • d) New

Answer: Heap


Question: Each object______has its own set of data.

  • a) Example
  • b) Instance
  • c) Function
  • d) Method

Answer: Instance


Question: Instance variables and instance methods are accessed via_______

  • a) Classes
  • b) Variables
  • c) Operators
  • d) Objects

Answer: Objects


Question: Objects can be referred by using_____operator.

  • a) Colon (:)
  • b) Underscore(_)
  • c) Dot (.)
  • d) Angle Bracket(<)

Answer: Dot (.)


Question: The_____is an operator.

  • a) Colon (:)
  • b) Underscore(_)
  • c) Dot (.)
  • d) Angle Bracket(<)

Answer: Dot (.)


Question: Associatively of______operator is from left to right.

  • a) Colon (:)
  • b) Underscore(_)
  • c) Dot (.)
  • d) Angle Bracket(<)

Answer: Dot (.)


Question: Protection of data is possible with the use of access______

  • a) Modifiers
  • b) Operators
  • c) Methods
  • d) None of these

Answer: Modifiers


Question: When the instance variables are referred within the methods of the same class, there is no need to use______operator.

  • a) Colon (:)
  • b) Underscore(_)
  • c) Dot (.)
  • d) Angle Bracket(<)

Answer: Dot (.)


Question: When the programmer declares an object_______object is not created.

  • a) Class
  • b) Variable
  • c) Operator
  • d) Method

Answer: Class


Question: Reference variable does not refer to any object and its initial value is_____by default.

  • a) Zero
  • b) One
  • c) Null
  • d) Minus one

Answer: Null


Question: Use of null reference or null pointer is illegal and may raise an_______

  • a) Exception
  • b) Negative value
  • c) Reference value
  • d) None of these

Answer: Exception


Question: Referring instance variable or invoking method with null reference will give an______

  • a) Example
  • b) Error
  • c) Mistake
  • d) Inaccurate result

Answer: Error


Question: The following code is_______System.out.println(rl.length);

  • a) Legal
  • b) Illegal
  • c) Both (A) and (B)
  • d) None of these

Answer: Illegal


Question: When an object is created using new keyword, memory is allocated from_______area to store the value of its attributes.

  • a) Pile
  • b) Heap
  • c) Mound
  • d) New

Answer: Heap


Question: Every object has its own______variables occupying different space in memory.

  • a) Example
  • b) Instance
  • c) Function
  • d) Method

Answer: Instance


Question: To store the value, it requires only one______per class.

  • a) Class
  • b) Variable
  • c) Operator
  • d) Method

Answer: Variable


Question: Variables can be declared within a class using_______keyword before data type.

  • a) Public
  • b) New
  • c) Static
  • d) PrintIn

Answer: Static


Question: variables are called class variables.

  • a) Public
  • b) New
  • c) Static
  • d) Private

Answer: Static


Question: Values of instance variables are stored in______(memory allocated for the object).

  • a) Memory
  • b) Instance
  • c) Property
  • d) Method

Answer: Instance


Question: Values of_____variables are stored in class itself.

  • a) Class
  • b) Variable
  • c) Operator
  • d) Method

Answer: Class


Question: _______variables can be accessed without creating an instance of a class.

  • a) Public
  • b) New
  • c) Static
  • d) Private

Answer: Static


Question: Just like class variable, class_______can be defined using static keyword in front of the method definition.

  • a) Class
  • b) Variable
  • c) Operator
  • d) Method

Answer: Method


Question: ________variables and class methods can be accessed outside the class.

  • a) Class
  • b) Variable
  • c) Operator
  • d) Method

Answer: Class

 

Question: If the requirement is there that private data has to be modified by others, then___methods have to be written.

  • a) Accessor
  • b) Mutator
  • c) Restricted
  • d) Prefixed

Answer: Mutator


Question: Conventionally, naming of accessor and mutator methods is to capitalize the first letter of variable name and then prepend the variable name with the prefixes______respectively.

  • a) Set and get
  • b) Get and setter
  • c) Getter and set
  • d) Get and set

Answer: Get and set


Question: methods are also known as "getter".

  • a) Accessor
  • b) Mutator
  • c) Restricted
  • d) Prefixed

Answer: Accessor


Question: ______methods are also known as "setter".

  • a) Accessor
  • b) Mutator
  • c) Restricted
  • d) Prefixed

Answer: Mutator


Question: _______methods should be used to allow other methods to read only the data value.

  • a) Get
  • b) Set
  • c) Getter
  • d) Setter

Answer: Getter


Question: _____methods should be used to allow other methods to modify the data value.

  • a) Get
  • b) Set
  • c) Getter
  • d) Setter

Answer: Setter


Question: Just like variables of primitive data types and available built-in data types, objects can also be passed as_______in a method.

  • a) Parameters
  • b) Limit
  • c) Protocols
  • d) None of these

Answer: Parameters


Question: ______of primitive types are passed by value.

  • a) Parameters
  • b) Limit
  • c) Protocols
  • d) None of these

Answer: Parameters


Question: The values of actual______are copied to formal parameters and then function is executed.

  • a) Parameters
  • b) Limit
  • c) Protocols
  • d) None of these

Answer: Parameters


Question: Object parameters are passed by_______

  • a) Memory value
  • b) Memory reference
  • c) Variable value
  • d) Reference

Answer: Reference


Question: An address (and not value) of the actual_______is copied to formal parameter.

  • a) Protocol
  • b) Parameter
  • c) Value
  • d) All of these

Answer: Parameter


Question: Object-oriented programming languages provide reusability feature using_______

  • a) Polymorphism
  • b) Parameters
  • c) Inheritance
  • d) All of these

Answer: Inheritance


Question: ______allows us to build new class with added capabilities by extending existing class.

  • a) Polymorphism
  • b) Parameters
  • c) Inheritance
  • d) All of these

Answer: Inheritance


Question: Inheritance models______relationship between two classes.

  • a) 'is-a'
  • b) 'its-a'
  • c) 'has-a'
  • d) 'is-at'

Answer: 'is-a'


Question: _____class is also referred to as super class or base class.

  • a) Child
  • b) Parent
  • c) Sub
  • d) None of these

Answer: Parent


Question: In the same way; child class is also referred to as_____derived class or extended class.

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Sub Class


Question: Whenever two classes have_______relationship, inheritance is used.

  • a) 'is-a'
  • b) 'its-a'
  • c) 'has-a'
  • d) 'is-at'

Answer: 'is-a'


Question: A________inherits all instance variables and methods from super class and it may have its own added variables and methods.

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Sub Class


Question: Constructors are not inherited in_______

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Sub Class


Question: ______inherits all methods of super class and it may have additional methods.

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Sub Class


Question: A sub class is not a subset of______In fact, sub class usually contains more information and methods than its super class.

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Super class


Question: When an object of_____is instantiated, memory is allocated for all its attributes including inherited ones.

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Sub Class


Question: In Java, to create a sub class, keyword '_____' is used in the class definition.

  • a) Extends
  • b) Int
  • c) Float
  • d) Create

Answer: Extends


Question: If the visibility of instance variables of_______is changed to private, the variables are not directly accessible outside the class.

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Super class


Question: _______members are directly available only in the class in which they are defined and nowhere else.

  • a) Public
  • b) Private
  • c) Protected
  • d) Packaged

Answer: Private


Question: _______members are available as 'private' members in the inherited sub class.

  • a) Public
  • b) Private
  • c) Protected
  • d) Packaged

Answer: Protected


Question: Java does not support multiple_______

  • a) Polymorphism
  • b) Parameters
  • c) Inheritance
  • d) All of these

Answer: Inheritance


Question: A sub class can be derived from only one_______

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Sub Class


Question: Which of the following defines attributes and methods ?

  • a) Class
  • b) Object
  • c) Instance
  • d) Variable

Answer: Class


Question: Which of the following keyword is used to declare Class variables and class methods ?

  • a) Static
  • b) Private
  • c) Public
  • d) Package

Answer: Static

 

Question: Which of the following operator creates an object and returns its reference ?

  • a) Dot (.)
  • b) New
  • c) Colon (:)
  • d) Assignment (=)

Answer: New


Question: 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 the above

Answer: Class method


Question: Which of the following refers more than one method having same name but different parameters ?

  • a) Overloaded methods
  • b) Overridden methods
  • c) Duplicate methods
  • d) All of the above

Answer: Overloaded methods


Question: Which method is invoked automatically with creation of an object ?

  • a) Instance method
  • b) Constructor
  • c) Class method
  • d) All of the above

Answer: Constructor


Question: Which of the following is the keyword used to refer a superclass constructor in sub class constructor ?

  • a) Extends
  • b) Super
  • c) Name of the superclass
  • d) New

Answer: Extends


Question: 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 object, dot(.) and the name of the method
  • c) The name of the class, colon(:) and the name of the method
  • d) The name of the class, dot(.) and the name of the method

Answer: The name of the object, dot(.) and the name of the method


Question: _______members are directly available only in the class in which they are defined and nowhere else.

  • a) Public
  • b) Private
  • c) Protected
  • d) Packaged

Answer: Private


Question: _______members are available as 'private' members in the inherited sub class.

  • a) Public
  • b) Private
  • c) Protected
  • d) Packaged

Answer: Protected


Question: Java does not support multiple__________

  • a) Polymorphism
  • b) Parameters
  • c) Inheritance
  • d) All of these

Answer: Inheritance


Question: A sub class can be derived from only one_________

  • a) Inherited Class
  • b) Parent Class
  • c) Sub Class
  • d) Super class

Answer: Sub Class

 

Question: ________methods are global to the class itself and available to any other classes or objects.

  • a) Class
  • b) Variable
  • c) Operator
  • d) Method

Answer: Class


Question: Class methods can be used anywhere regardless of whether an_______of the class exists or not.

  • a) Example
  • b) Instance
  • c) Illustration
  • d) Method

Answer: Instance


Question: The methods that operate on a particular object, or affect that object, should be defined as_____methods.

  • a) Example
  • b) Instance
  • c) Illustration
  • d) Method

Answer: Instance


Question: _______that provide some general utility but do not directly affect an instance of the class are better declared as class methods.

  • a) Methods
  • b) Functions
  • c) Instances
  • d) Examples

Answer: Methods


Question: The designers of Java have already provided a large number of______classes with such class methods.

  • a) Programmed
  • b) Internal
  • c) Built-in
  • d) Built-out

Answer: Built-in


Question: The______definitions in the source code specify the things that are part of the class itself.

  • a) Public
  • b) Non-static
  • c) Static
  • d) Private

Answer: Static


Question: The______definitions in the source code specify the things that will become part of every instance object belonging to a class.

  • a) Public
  • b) Non-static
  • c) Static
  • d) Private

Answer: Non-static


Question: Class variables and class methods can be accessed using a class name or_____variable.

  • a) Reference
  • b) Instance
  • c) New
  • d) Private

Answer: Reference


Question: Class variables and class methods can be accessed from_____methods also.

  • a) Reference
  • b) Instance
  • c) New
  • d) Private

Answer: Instance


Question: Instance variables and______methods can't be accessed from class methods, as class methods do not belong to any object.

  • a) Reference
  • b) Instance
  • c) New
  • d) Private

Answer: Instance


Question: Variables defined inside methods or blocks are called_____variables.

  • a) Public
  • b) Global
  • c) Private
  • d) Local

Answer: Local


Question: Formal parameters of the methods are also______variables.

  • a) Public
  • b) Global
  • c) Private
  • d) Local

Answer: Local


Question: _______variables are not initialized by default values.

  • a) Public
  • b) Global
  • c) Private
  • d) Local

Answer: Local


Question: ________variables are variables defined within a class but outside any method.

  • a) Instance
  • b) Private
  • c) Local
  • d) Global

Answer: Instance


Question: ________variables are allocated memory from heap area when an object is instantiated (created).

  • a) Class
  • b) Instance
  • c) Local
  • d) Global

Answer: Instance


Question: _______variables are initialized by default values.

  • a) Class
  • b) Instance
  • c) Local
  • d) Global

Answer: Instance


Question: _______variables are variables defined within a class, outside any method, with the static keyword.

  • a) Class
  • b) Instance
  • c) Local
  • d) Global

Answer: Class


Question: _______variables are allocated memory only once per class and is shared by all its objects.

  • a) Class
  • b) Instance
  • c) Local
  • d) Global

Answer: Class


Question: ______variables are initialized with default values.

  • a) Class
  • b) Instance
  • c) Local
  • d) Global

Answer: Class


Question: _____requires the use of constructors.

  • a) Declaration
  • b) Instantiation
  • c) Initialization
  • d) Inheritance

Answer: Initialization


Question: The word________means "many forms"; different forms of methods with same name. 

  • a) Declaration
  • b) Instantiation
  • c) Polymorphism
  • d) Inheritance

Answer: Polymorphism


Question: In Java, there can be different methods that have the same name but different_________

  • a) Variables
  • b) Declarations
  • c) Programs
  • d) Signature

Answer: Signature


Question: The above feature of Java is called________

  • a) Method Overloading
  • b) Method Offloading
  • c) Variable Overloading
  • d) Program Overloading

Answer: Method Overloading


Question: The methods______is a combination of the method name, the type of return value (object or base type), a list of parameters.

  • a) Variables
  • b) Declarations
  • c) Programs
  • d) Signature

Answer: Signature


Question: The example given below is an example of : static int max(int x, int y) {...} static int max(int x, int y, int z) {...} static double max(double x, double y, double z)

  • a) Method Overloading
  • b) Method Offloading
  • c) Variable Overloading
  • d) Program Overloading

Answer: Method Overloading


Question: _______is a special kind of method that is invoked when a new object is created.

  • a) Destructor
  • b) Constructor
  • c) Invoker
  • d) Creator

Answer: Constructor


Question: can perform any action; but it is mainly designed to perform initializing actions.

  • a) Destructor
  • b) Constructor
  • c) Invoker
  • d) Creator

Answer: Constructor


Question: Every class is having its default constructor; sometimes referred to as no-argument________

  • a) Destructor
  • b) Constructor
  • c) Invoker
  • d) Creator

Answer: Constructor


Question: Default_____does not take any argument.

  • a) Destructor
  • b) Invoker
  • c) Constructor
  • d) Creator

Answer: Constructor


Question: ________initializes the attributes of a newly created object using default values based on their data types.

  • a) Destructor
  • b) Invoker
  • c) Constructor
  • d) Creator

Answer: Constructor

 

Question: Constructor must have the same______as class name.

  • a) Name
  • b) Style
  • c) Format
  • d) Arrangement

Answer: Name


Question: Constructor user not have______type.

  • a) Data
  • b) Return
  • c) Operator
  • d) All of these

Answer: Return


Question: Constructor is invoked implicitly only when an object is constructed using______operator.

  • a) new
  • b) New
  • c) NEW
  • d) nEW

Answer: new


Question: ______cannot be invoked explicitly elsewhere in the program.

  • a) Destructor
  • b) Invoker
  • c) Constructor
  • d) Creator

Answer: Constructor


Question: Like other methods, constructor can also be overloaded.

  • a) Destructor
  • b) Invoker
  • c) Constructor
  • d) Creator

Answer: Constructor


Question: In absence of______constructors in a class, objects are constructed using default no-arument constructor.

  • a) Denned
  • b) User-defined
  • c) Built in
  • d) Ready-made

Answer: User-defined


Question: A no-argument______initializes the attributes using default values.

  • a) Destructor
  • b) Invoker
  • c) Constructor
  • d) Creator

Answer: Constructor


Question: The syntax of a no-argument constructor is_______

  • a)[]
  • b){ };
  • c)( ) { }
  • d)( ) { };

Answer: ( ) { };


Question: _______control is about controlling visibility.

  • a) Access
  • b) Modifier
  • c) Visibility
  • d) Entrance

Answer: Access


Question: _______modifiers are also known as visibility modifiers.

  • a) Access
  • b) Modifier
  • c) Visibility
  • d) Entrance

Answer: Access


Question: If a method or variable is visible to another class, then only it can be referred in another_______

  • a) Class
  • b) Method
  • c) Program
  • d) Application

Answer: Class


Question: The Four P's of protection are

  • a) Public
  • b) Package (default protection)
  • c) Protected and Private
  • d) All of these

Answer: All of these


Question: ________modifiers public, protected and private are used before the type of variable or method.

  • a) Access
  • b) Modifier
  • c) Visibility
  • d) Entrance

Answer: Access


Question: ________is used to organize classes.

  • a) Public
  • b) Package
  • c) Protected
  • d) Private

Answer: Package


Question: _______statement should be added as the first non-comment or non-blank line in the source file.

  • a) Public
  • b) Package
  • c) Protected
  • d) Private

Answer: Package


Question: When a file does not have package statement, the classes defined in the file are placed in_______package.

  • a) Public
  • b) File
  • c) Default
  • d) Private

Answer: Default


Question: Package statement has_______syntax.

  • a) Package < packageName>;
  • b) Package < packageName>
  • c) Package < Name>;
  • d) Package packageName;

Answer: Package < packageName>;


Question: Any_______or variable is visible to the class in which it is defined.

  • a) Data type
  • b) Method
  • c) File
  • d) Information

Answer: Method


Question: To provide_______access, use access modifier public before type of variable or method.

  • a) Public
  • b) File
  • c) Default
  • d) Private

Answer: Public


Question: ________keyword has been used with main() method to make it available to everyone.

  • a) Public
  • b) File
  • c) Default
  • d) Private

Answer: Public


Question: ________keyword is used to allow the access only to sub classes or to share with the methods declared as "friend".

  • a) Public
  • b) Private
  • c) Protected
  • d) Default

Answer: Protected


Question: Use of______protection becomes more relevant when inheritance concept is used in object-oriented programming.

  • a) Public
  • b) Private
  • c) Protected
  • d) Default

Answer: Protected


Question: Highest level of protection can be achieved by using "_______" protection level.

  • a) Public
  • b) Private
  • c) Protected
  • d) Default

Answer: Private


Question: _______provides the narrowest visibility.

  • a) Public
  • b) Private
  • c) Protected
  • d) Default

Answer: Private


Question: The________methods and variables are directly accessible only by the methods defined within a class.

  • a) Public
  • b) Private
  • c) Protected
  • d) Default

Answer: Private


Question: ______methods may seem extremely restrictive, but it is, in fact, a commonly used level of protection.

  • a) Public
  • b) Private
  • c) Protected
  • d) Default

Answer: Private


Question: Private provides_____encapsulation; hiding data from the world's sight and limiting its manipulation.

  • a) Information
  • b) Variable
  • c) Data
  • d) Data type

Answer: Data


Question: Anything that shouldn't be directly shared with anyone including its sub class is_______

  • a) Public
  • b) Private
  • c) Protected
  • d) Default

Answer: Private


Question: When access to data is restricted by declaring them as________the purpose is to protect them from getting directly accessed or modified by methods of other class.

  • a) Public
  • b) Default
  • c) Protected
  • d) Private

Answer: Private


Question: If the requirement is there that private data has to be used by others, then_______methods have to be written.

  • a) Accessor
  • b) Mutator
  • c) Restricted
  • d) Prefixed

Answer: Accessor

Tags: 

 


Click for more Computer Science Study Material
Cascading Style Sheets and JavaScript
CBSE Class 12 Computer Science Cascading Style Sheets and JavaScript MCQs
Classes and Objects In Java
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set A
CBSE Class 12 Computer Science Classes and Objects In Java MCQs Set B
Creating HTML Forms Using KompoZer
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set A
CBSE Class 12 Computer Science Creating HTML Forms Using KompoZer MCQs Set B
Designing Simple Website Using Kompozer
CBSE Class 12 Computer Science Designing Simple Website Using Kompozer MCQs
Exception Handling In Java
CBSE Class 12 Computer Science Exception Handling In Java MCQs
File Handling
CBSE Class 12 Computer Science File Handling MCQs Set A
CBSE Class 12 Computer Science File Handling MCQs Set B
File System
CBSE Class 12 Computer Science File System MCQs Set A
CBSE Class 12 Computer Science File System MCQs Set B
Introduction To E Commerce
CBSE Class 12 Computer Science Introduction To E Commerce MCQs
Introduction To M Commerce
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set A
CBSE Class 12 Computer Science Introduction To M Commerce MCQs Set B
Java Basics
CBSE Class 12 Computer Science Java Basics MCQs Set A
CBSE Class 12 Computer Science Java Basics MCQs Set B
Object Oriented Concepts
CBSE Class 12 Computer Science Object Oriented Concepts MCQs
Publishing Documents Using Latex
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set A
CBSE Class 12 Computer Science Publishing Documents Using Latex MCQs Set B

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning

CBSE Reading Challenge

The acquisition of 21st century competencies of communication, critical and creative thinking and the ability to locate, understand and reflect on various kinds of information has become more crucial for our learners. It is well accepted that Reading Literacy is not...

CBSE OMR Sheet Guidelines for Term 1

You are aware that the CBSE will be using OMR for the first time for assessment of both the Classes-X and XII in Term-I examinations. Hence, there is a need that all the students appearing in the Term-l examinations and the schools sponsoring these students should have...

CBSE Class 10 Revised Syllabus

Last year CBSE had to reduce the syllabus because of the pandemic situation but it was not very effective because there were no examinations. This year to avoid any confusion and conflict, CBSE has decided to reduce the syllabus into term 1 and term 2. 50 percent of...

×
Studies Today