Java Programming (3350703) MCQs

MCQs of Object Oriented Programming Concepts

Showing 21 to 30 out of 35 Questions
21.

Variable within class declared known as ________.

(ક્લાસમા ડીકલેર કરેલ વેરીએબલ _________ તરીકે ઓળખવામાં આવે છે.)

(a)

Local Variable

(લોકલ વેરીએબલ)

(b)

Global Variable

(ગ્લોબલ વેરીએબલ)

(c)

Instance Variable

(ઇન્સ્ટન્શ વેરીએબલ)

(d)

None of given

(આપેલમાંથી એકપણ નહિ)

Answer:

Option (c)

22.

The method which does not return any value then return type of the method should be ________.

(મેથડ કે જે કોઈપણ વેલ્યુ રીટર્ન ન કરે તો તે મેથડ ની રીટર્ન ટાઈપ _________ હોવી જોઈએ.)

(a)

int

(b)

double

(c)

string

(d)

void

Answer:

Option (d)

23.

Which of the following is correct syntax to create object in java?

(Javaમા ઓબ્જેક્ટ બનાવવા માટે નીચે આપેલ સિન્ટેક્ષમાંથી કઈ સાચી છે?)

(a)

class _name   object_name;

(b)

class _name  object_name  =  class_name;

(c)

class_name   object_name  =  new   class_name;

(d)

class_name  object_name  =  new   class_name();

Answer:

Option (d)

24.

Which of the following access specifiers must be used for main() method in java?

(Javaમા main() મેથડ માટે ક્યા એક્સેસ સ્પેસીફાયરનો ઉપયોગ કરવો જરૂરી છે?)

(a)

public

(b)

protected

(c)

private

(d)

None of given

(આપેલમાંથી એકપણ નહિ)

Answer:

Option (a)

25.

Which of the following is most restrictive access specifier?

(નીચે આપેલમાંથી કયો વિકલ્પ સૌથી વધારે રેસ્ટ્રીક્ટીવ એક્સેસ સ્પેસીફાઈર છે?)

(a)

private

(b)

protected

(c)

public 

(d)

None of given

(આપેલમાંથી એકપણ નહિ)

Answer:

Option (a)

26.

State true or false: private declared variable within class can be access outside class.

(આપેલ વિધાન સાચું છે કે ખોટું: ક્લાસમાં private ડીકલેર કરેલ વેરિએબલ ક્લાસની બહાર એક્સેસ થઇ શકે છે.)

(a)

TRUE

(b)

FALSE

Answer:

Option (b)

27.

A variable or method declared using protected access control modifier can be access _________.

(વેરીએબલ અથવા મેથડ કે જેને protected એક્સેસ કંટ્રોલ મોડીફાયર નો ઉપયોગ કરી ડીકલેર કરેલ હોય તે _______ મા એક્સેસ થઈ શકે છે.)

(a)

within package only

(ફક્ત પેકેજમા જ)

(b)

only outside package

(ફક્ત પેકેજની બહાર)

(c)

in any class within package and non sub-class in other package

(એ પેકેજનાકોઈપણ ક્લાસમા અને બીજા પેકેજમા સબ-ક્લાસ ન હોય તેમાં)

(d)

in any class within package and sub-class in other package

(એ પેકેજના કોઈપણ ક્લાસમા અને બીજા પેકેજના સબ-ક્લાસ હોય તેમાં)

Answer:

Option (d)

28.

Which of following is incorrect for "this" keyword?

("this" કીવર્ડ માટે નીચે આપેલમાંથી કયો વિકલ્પ ખોટો છે?)

(a)

this.methodName(args);

(b)

this{statements;}

(c)

this(args);

(d)

this.variableName;

Answer:

Option (b)

29.

The process of defining two or more methods within same class that have same name but different parameters declaration is known as _________.

(એક જ ક્લાસમાં રહેલ બે અથવા વધારે મેથડ કે જેના નામ સરખા હોય પરંતુ પેરામીટરના ડિક્લેરેશન અલગ-અલગ હોય તેને  _______ તરીકે ઓળખવામાં આવે છે.)

(a)

Method Hiding

(મેથડ હાઈડીંગ)

(b)

Method Overriding

(મેથડ ઓવરરાઇડીંગ)

(c)

Method Overloading

(મેથડ ઓવરલોડીંગ)

(d)

None of given

(આપેલમાંથી એકપણ નહિ)

Answer:

Option (c)

30.

Method overloading is also known as________.

(મેથડ ઓવરલોડીંગ ને ___________ તરીકે પણ ઓળખવામા આવે છે.)

(a)

Compiletime polymorphism

(કમ્પાઈલટાઈમ પોલીમોર્ફીઝમ)

(b)

Runtime polymorphism

(રનટાઈમ પોલીમોર્ફીઝમ)

(c)

Both Compiletime polymorphism and Runtime polymorphism

(કમ્પાઈલટાઈમ અને રનટાઈમ પોલીમોર્ફીઝમ બંને)

(d)

None of given

(આપેલમાંથી એકપણ નહિ)

Answer:

Option (a)

Showing 21 to 30 out of 35 Questions