Object Oriented Programming MCQs

Page No. 23

How many public class(s) (outermost) can be there in a java program?


a1

✓


b2

✖


c3

✖


dAs required

✖


View Answer 1

If members of a super class are public, then________


aAll those will be available in subclasses

✓


b None of those will be available in subclasses

✖


cOnly data members will be available in subclass

✖


dOnly member functions will be available in subclass

✖



We can reduce the visibility of inherited methods.


aTrue

✖


bFalse

✓


cA & B

✖


dNone of these

✖


View Answer False

Which among the following can be used for outermost class access specifier in java?


aPrivate

✖


bPublic

✖


cDefault

✖


dDefault or Public

✓


View Answer Default or Public

Which among the following have least security according to the access permissions allowed?


aPrivate

✖


b Default

✖


cProtected

✖


dPublic

✓


View Answer Public

If the members have to be accessed from anywhere in the program and other packages also, which access specifier should be used?


aPublic

✓


bPrivate

✖


cProtected

✖


d Default

✖


View Answer Public

Which among the following is true for the code given below?


a Only object of class A can access disp() function

✖


b Only object of class B can access disp() function

✖


cBoth instances can access disp() function

✖


dAccessing disp() outside class is not possible

✓



Which among the following is not allowed for data member declaration?


aint a;

✖


bstatic int a;

✖


c abstract a;

✓


dBoolean a;

✖


View Answer abstract a;

The arguments passed to member functions by reference are considered as data members of class.


aTrue

✖


bFalse

✓


cA & B

✖


dNone of these

✖


View Answer False

Which data members can be inherited but are private to a class?


aPrivate

✖


bProtected

✓


cProtected and Static

✖


dPrivately inherited

✖


View Answer Protected

Goto Page No.

Page 23 of 93

Alphabetical MCQs Categories
—

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"
—

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan