Questions · Page 2 of 10

MCQ

MCQ 511 Mark
Conventionally, naming of accessory and matador methods is to capitalize the first letter of variable name and then prepend the variable name with the following prefixes respectively?
  • A
    getter and setter
  • B
    set and get
  • get and set
  • D
    gt and st
Answer
Correct option: C.
get and set
get and set
View full question & answer
MCQ 521 Mark
Which method can we write if we want to allow data to be modified by other?
  • Mutator
  • B
    Accessor
  • C
    Contractor
  • D
    main 0
Answer
Correct option: A.
Mutator
Mutator
View full question & answer
MCQ 531 Mark
Which method can we write if we want to allow data to be used by others?
  • A
    Mutator
  • Accessor
  • C
    Contractor
  • D
    main 0
Answer
Correct option: B.
Accessor
Accessor
View full question & answer
MCQ 541 Mark
Which of the following minimizes the amount of information one class needs to know about another get its job done?
  • Data Encapsulation
  • B
    Polymorphism
  • C
    Inheritance
  • D
    Aggregation
Answer
Correct option: A.
Data Encapsulation
Data Encapsulation
View full question & answer
MCQ 551 Mark
Which of the following separates design from implementation?
  • Data Encapsulation
  • B
    Polymorphism
  • C
    Inheritance
  • D
    Aggregation
Answer
Correct option: A.
Data Encapsulation
Data Encapsulation
View full question & answer
MCQ 561 Mark
What is the thing that should not be directly shared with anyone including its subclass?
  • A
    protected
  • B
    public
  • private
  • D
    package
Answer
Correct option: C.
private
private
View full question & answer
MCQ 571 Mark
Which of the following is the best way to make data as much private as possible?
  • Data Encapsulation
  • B
    Polymorphism
  • C
    Inheritance
  • D
    Aggregation
Answer
Correct option: A.
Data Encapsulation
Data Encapsulation
View full question & answer
MCQ 581 Mark
Which of the following hides data from the world’s sight and limiting its manipulation?
  • Data Encapsulation
  • B
    Polymorphism
  • C
    Inheritance
  • D
    Aggregation
Answer
Correct option: A.
Data Encapsulation
Data Encapsulation
View full question & answer
MCQ 591 Mark
Which of the following statements is true for private modifier?
  • A
    The visibility of this modifier is very restrictive.
  • B
    It is a commonly used level of protection.
  • C
    It provides data encapsulation.
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 601 Mark
Which type of visibility is provided by private modifier?
  • Very less
  • B
    Less
  • C
    To much
  • D
    More
Answer
Correct option: A.
Very less
Very less
View full question & answer
MCQ 611 Mark
Which access modifiers cannot be seen by other class?
  • A
    public
  • private
  • C
    protected
  • D
    package
Answer
Correct option: B.
private
private
View full question & answer
MCQ 621 Mark
Which of the following methods and variables are directly accessible only by the method defined within a class?
  • private
  • B
    public
  • C
    protected
  • D
    package
Answer
Correct option: A.
private
private
View full question & answer
MCQ 631 Mark
Which of the following visibility provides the narrowest visibility?
  • A
    protected
  • private
  • C
    public
  • D
    package
Answer
Correct option: B.
private
private
View full question & answer
MCQ 641 Mark
By using which of the following protection the highest level protection can be achieved?
  • A
    protected
  • private
  • C
    public
  • D
    package
Answer
Correct option: B.
private
private
View full question & answer
MCQ 651 Mark
Which of the following is a fourth level visibility access?
  • private
  • B
    protected
  • C
    public
  • D
    package
Answer
Correct option: A.
private
private
View full question & answer
MCQ 661 Mark
Which of the following protection will become more relevant when we use inheritance concept of object-oriented programming?
  • A
    private
  • protected
  • C
    public
  • D
    package
Answer
Correct option: B.
protected
protected
View full question & answer
MCQ 671 Mark
How is-the visibility of protected level as compared to that of the “private” level when full privacy is provided?
  • More
  • B
    Less
  • C
    Average
  • D
    None of these
Answer
Correct option: A.
More
More
View full question & answer
MCQ 681 Mark
How is the visibility of protected level as compared to that of the public and package level?
  • Less
  • B
    More
  • C
    Average
  • D
    None of these
Answer
Correct option: A.
Less
Less
View full question & answer
MCQ 691 Mark
Which of the following is the third level visibility access?
  • A
    private
  • protected
  • C
    public
  • D
    package
Answer
Correct option: B.
protected
protected
View full question & answer
MCQ 701 Mark
Which of the following levels is used to allow the access only to subclass or to share with the methods declared as “friend”?
  • protected
  • B
    private
  • C
    public
  • D
    package
Answer
Correct option: A.
protected
protected
View full question & answer
MCQ 711 Mark
From where can the variable or the method be accessed in the package?
  • From anywhere that contains the class
  • B
    From outside the package
  • C
    a Or b
  • D
    None of these
Answer
Correct option: A.
From anywhere that contains the class
From anywhere that contains the class
View full question & answer
MCQ 721 Mark
How is the scope of package modifier as compared to that of the public?
  • Less
  • B
    More
  • C
    So less
  • D
    Cannot be determine
Answer
Correct option: A.
Less
Less
View full question & answer
MCQ 731 Mark
Whose scope is narrower than public variables?
  • package
  • B
    private
  • C
    public
  • D
    protected
Answer
Correct option: A.
package
package
View full question & answer
MCQ 741 Mark
Which is the default level of protection?
  • package
  • B
    private
  • C
    public
  • D
    protected
Answer
Correct option: A.
package
package
View full question & answer
MCQ 751 Mark
Which of the following is the second level of access that has no precise name?
  • package
  • B
    protected
  • C
    public
  • D
    private
Answer
Correct option: A.
package
package
View full question & answer
MCQ 761 Mark
From where can public variables and methods be accessed?
  • A
    From the other source file
  • B
    From the other package
  • 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 771 Mark
Where are public variables and methods visible?
  • A
    Only at one place
  • Any where
  • C
    Only in two classes
  • D
    Only in defined classes
Answer
Correct option: B.
Any where
Any where
View full question & answer
MCQ 781 Mark
Which access modifier is given before type of variable or method to provide public access?
  • public
  • B
    private
  • C
    package
  • D
    protected
Answer
Correct option: A.
public
public
View full question & answer
MCQ 791 Mark
Which of the following access modifier provides visibility to classes defined in other package also?
  • public
  • B
    private
  • C
    protected
  • D
    package
Answer
Correct option: A.
public
public
View full question & answer
MCQ 801 Mark
‘Which has the widest possible access?
  • public
  • B
    private
  • C
    protected
  • D
    package
Answer
Correct option: A.
public
public
View full question & answer
MCQ 811 Mark
How is the method or variable declared as if we want to make it visible to all the classes outside the class?
  • public
  • B
    private
  • C
    protected
  • D
    package
Answer
Correct option: A.
public
public
View full question & answer
MCQ 821 Mark
“Any method or variable is visible to the class in which it is defined.” Specify this statement.
  • This statement is true.
  • B
    This statement is false.
  • C
    It depends on method.
  • D
    It depends on class.
Answer
Correct option: A.
This statement is true.
This statement is true.
View full question & answer
MCQ 841 Mark
Where are the classes defined when a file does not have package statement?
  • Default package
  • B
    Public
  • C
    Private
  • D
    Protected
Answer
Correct option: A.
Default package
Default package
View full question & answer
MCQ 851 Mark
Where is the package statement added in the source file?
  • A
    At the first non-comment line
  • B
    At the first non-blank line
  • 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 861 Mark
Which of the following visibility is used to organize classes?
  • Package
  • B
    Public
  • C
    Private
  • D
    Protected
Answer
Correct option: A.
Package
Package
View full question & answer
MCQ 871 Mark
Which is the default visibility to protect method or variable?
  • Package
  • B
    Private
  • C
    Protected
  • D
    Public
Answer
Correct option: A.
Package
Package
View full question & answer
MCQ 881 Mark
Which is the default visibility?
  • Package
  • B
    Public
  • C
    Private
  • D
    Protected
Answer
Correct option: A.
Package
Package
View full question & answer
MCQ 891 Mark
Which modifier is counted when no modifier is used?
  • Package
  • B
    Public
  • C
    Private
  • D
    Protected
Answer
Correct option: A.
Package
Package
View full question & answer
MCQ 901 Mark
Which of the following access modifiers are used before the type of variable or method?
  • A
    public
  • B
    private
  • C
    protected
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 911 Mark
Specify the p’s of protections or security?
  • A
    public
  • B
    package
  • C
    protected and private
  • All of these
Answer
Correct option: D.
All of these
All of these
View full question & answer
MCQ 931 Mark
How many levels of visibility do we use to protect a method or variable for necessary protection?
  • Four
  • B
    Five
  • C
    Three
  • D
    Six
Answer
Correct option: A.
Four
Four
View full question & answer
MCQ 941 Mark
Access modifiers are also known as following.
  • Visibility modifier
  • B
    Permission modifier
  • C
    Usage modifier
  • D
    None of these
Answer
Correct option: A.
Visibility modifier
Visibility modifier
View full question & answer
MCQ 951 Mark
Which of the following is about controlling visibility?
  • Access control
  • B
    Access usage
  • C
    Access permission
  • D
    None of these
Answer
Correct option: A.
Access control
Access control
View full question & answer
MCQ 961 Mark
What happens by an attempt to create an using constructor without arguments?
  • A
    Compiler does not return error.
  • B
    An object is made.
  • Compiler returns an error.
  • D
    None of these
Answer
Correct option: C.
Compiler returns an error.
Compiler returns an error.
View full question & answer
MCQ 971 Mark
Which constructor is no more available in presence of user defined constructors in a class?
  • Default
  • B
    Decided
  • C
    Basic
  • D
    Standard
Answer
Correct option: A.
Default
Default
View full question & answer
MCQ 981 Mark
How is constructor overloading possible?
  • With varying list of parameters
  • B
    With same list of parameters
  • C
    a and b both
  • D
    None of these
Answer
Correct option: A.
With varying list of parameters
With varying list of parameters
View full question & answer
MCQ 991 Mark
What can be done with constructor like that in other methods?
  • A
    Overwrite
  • Overload
  • C
    Offload
  • D
    On load
Answer
Correct option: B.
Overload
Overload
View full question & answer
MCQ 1001 Mark
What cannot be invoked explicitly elsewhere in the program?
  • Constructor
  • B
    Instance
  • C
    Signature
  • D
    None of these
Answer
Correct option: A.
Constructor
Constructor
View full question & answer
MCQ - Page 2 - COMPUTER STD 12 Science Questions - Vidyadip