MCQs on Java

Ques 1

UPP Programmer 2013

जावा के संदर्भ में कचरा संग्रहण क्या है?

What is garbage collection in the context of Java ?

[A] The operating system periodically deletes all of the java files available on the system.

[B] Any package imported in a program and not used is automatically deleted.

[C] The JVM checks the output of any Java program and deletes anything that doesn’t make sense.

[D] When all references to an object are gone, the memory used by the object is automatically reclaimed.

Correct Answer : When all references to an object are gone, the memory used by the object is automatically reclaimed.


Ques 2

UPP Programmer 2013

जावा के संदर्भ में बाइट कोड क्या है?

What is byte code in the context of Java ?

[A] The type of code generated by a Java compiler

[B] The type of code generated by a Java Virtual Machine

[C] It is another name for a Java source file

[D] It is the code written within the instance methods of a class

Correct Answer : The type of code generated by a Java Virtual Machine


Ques 3

UPP Programmer 2013

जावा में कौन सा वर्ग उपवर्ग नहीं हो सकता?

In Java which class cannot be a subclass ?

[A] Abstract

[B] Parent

[C] Final

[D] None

Correct Answer : Final


Ques 4

UPP Programmer 2013

निम्नलिखित में से कौन सा वेरिएबल डिक्लेरेशन जावा प्रोग्राम में संकलित नहीं किया जाएगा?

Which of the following variable declaration would not be compiled in a Java program ?

 

[A] int var;

[B] int VAR;

[C] int var1;

[D] int 1_var

Correct Answer : int 1_var


Ques 5

MPESB Group-4 2023

__________ नियमों का समूह है जो संरचित जावास्क्रिप्ट को परिभाषित करता है।

__________ is the set of rules that define a structured JavaScript.

[A] Server-side JavaScript

[B] Javascript Syntax

[C] Client-side JavaScript

[D] script Javascript

Correct Answer : Javascript Syntax


Ques 6

Chhattisgarh ITI 2023

एनिमेशन के समय और अनुक्रम को नियंत्रित करने के लिए आमतौर पर किस जावास्क्रिप्ट विधि का उपयोग किया जाता है?

Which JavaScript method is commonly used to control the timing and sequencing of animations?

[A] setInterval()

[B] setTimeout()

[C] requestAnimationFrame()

[D] clearTimeout()

Correct Answer : setTimeout()


Ques 7

Chhattisgarh ITI 2023

निम्नलिखित कोड स्निपेट का आउटपुट क्या है?

What is the output of the following code snippet?

const chkStr = str => str ===
str.split('''') .reverse().join('''');
console.log(chkStr (''ITI ''));

[A] Checks if a string contains a palindrome

[B] Removes whitespace from the beginning and end of a string

[C] Converts all characters in a string to lowercase

[D] Capitalizes the first letter of each word in a string

Correct Answer : Checks if a string contains a palindrome


Ques 8

Chhattisgarh ITI 2023

मानों के संग्रह को दर्शाने के लिए किस जावास्क्रिप्ट डेटा प्रकार का उपयोग किया जाता है, जहां प्रत्येक मान को एक अद्वितीय कुंजी द्वारा पहचाना जाता है?

Which JavaScript data type is used to represent a collection of values, where each value is identified by a unique key?

[A] Array

[B] Object

[C] Set

[D] Map

Correct Answer : Object


Ques 9

Chhattisgarh ITI 2023

निम्नलिखित जावास्क्रिप्ट कोड का परिणाम क्या है?

What is the result of the following JavaScript code?

console.log(typeof null);

[A] “object”

[B] “null”

[C] “undefined”

[D] “string”

Correct Answer : “object”


Ques 10

Chhattisgarh ITI 2023

निम्नलिखित कोड स्निपेट का आउटपुट क्या है?

What is the output of the following code snippet?

let sum = 0;
for (let i = 0; i <= 10; i++) {
if(i % 2 === 0) {
continue;
}
sum +=i;
}
console.log(sum);

[A] 20

[B] 25

[C] 30

[D] 35

Correct Answer : 25


Ques 11

Chhattisgarh ITI 2023

जावास्क्रिप्ट में किस अंतर्निहित फ़ंक्शन का उपयोग किसी निर्दिष्ट मूलांक का उपयोग करके किसी संख्या को स्ट्रिंग में बदलने के लिए किया जाता है?

Which built-in function in JavaScript is used to convert a number to a string, using a specified radix?

[A] toString()

[B] convertToString()

[C] stringify()

[D] radixToString()

Correct Answer : toString()


Ques 12

Chhattisgarh ITI 2023

ब्राउज़र कंसोल पर संदेशों को लॉग करने के लिए किस जावास्क्रिप्ट फ़ंक्शन का उपयोग किया जाता है?

Which JavaScript function is used to log messages to the browser console?

[A] HTTP

[B] Marquee

[C] Hyperlink

[D] IP address

Correct Answer : Hyperlink


Ques 13

Chhattisgarh ITI 2023

निम्नलिखित कोड स्निपेट का आउटपुट क्या है?

What is the output of the following code snippet?

const arr = [10, 20, 30, 40, 50];
const result = arr.map(num => num >
30);
console.log(result);

[A] [false, false, false, true, true]

[B] [true, true, true, false, false]

[C] [false, false, true, true, true]

[D] [true, true, true, true, true]

Correct Answer : [false, false, false, true, true]


Ques 14

Chhattisgarh ITI 2023

जावास्क्रिप्ट में सख्त समानता तुलना करने के लिए किस ऑपरेटर का उपयोग किया जाता है?

Which operator is used to perform strict equality comparison in JavaScript?

[A] ==

[B] ===

[C] !=

[D] !==

Correct Answer : ===


Ques 15

Chhattisgarh ITI 2023

जावास्क्रिप्ट ऑब्जेक्ट मॉडल के बारे में निम्नलिखित में से कौन सा कथन सत्य है?

Which of the following statements is true about the JavaScript object model?

[A] It is a hierarchical representation of objects and their relationships.

[B] It is a graphical representation of objects and their properties.

[C] It is a collection of predefined objects provided by the JavaScript engine.

[D] It is a programming paradigm used in JavaScript for object-oriented programming.

Correct Answer : It is a hierarchical representation of objects and their relationships.


Ques 16

Chhattisgarh ITI 2023

निम्नलिखित में से कौन सा विकल्प जावास्क्रिप्ट के 'टाइपऑफ़' ऑपरेटर के व्यवहार का सही वर्णन करता है?

Which of the following options correctly describes the behaviour of JavaScript’s ‘typeof’ operator?

[A] It returns the specific data type of a value.

[B] It returns a string representation of the data type of a value.

[C] It returns a Boolean value indicating if a value is null or not.

[D] It returns the memory size in bytes occupied by a value.

Correct Answer : It returns a string representation of the data type of a value.


Ques 17

Chhattisgarh ITI 2023

निम्नलिखित कोड स्निपेट का आउटपुट क्या है?

What is the output of the following code snippet?

console.log(Math.floor(-4.7));

[A] -4

[B] -5

[C] 4

[D] 5

Correct Answer : -5


Ques 18

Chhattisgarh ITI 2023

जावास्क्रिप्ट ऑब्जेक्ट मॉडल में मैथ, ऐरे और स्ट्रिंग जैसे अंतर्निहित ऑब्जेक्ट शामिल हैं। ये वस्तुएं इसका हिस्सा हैं:

The JavaScript object model consists of built-in objects such as Math, Array and String. These objects are part of the:

[A] BOM (Browser Object Model)

[B] DOM (Document Object Model)

[C] ECMAScript standard

[D] JavaScript runtime environment

Correct Answer : ECMAScript standard


Ques 19

UPPCL-TG2-2021

निम्नलिखित में से कौन सी भाषा उच्च स्तरीय भाषा है?

Which of the following language is a high -level language ?

[A] Machine language

[B] binary language

[C] Java

[D] MSIL (Microsoft Intermediate Language)

Correct Answer : Java


Ques 20

CTS COPA 2024

जावा प्रोग्रामिंग भाषा का पहले नाम __ था

Earlier name of Java Programming language was __

[A] Eclipse

[B] Oak

[C] Netbean

[D] Pycharm

Correct Answer : Oak


Ques 21

CTS COPA 2024

जावा में पैकेज को परिभाषित करने के लिए इनमें से किस कीवर्ड का उपयोग किया जाता है?

Which of these keywords is used to define packages in Java?

[A] pkg

[B] Pkg

[C] package

[D] Package

Correct Answer : package


Ques 22

CTS-COPA 2024

HTML द्वारा होस्ट किए गए जावा एप्लेट क्लासेस की व्याख्या और निष्पादन के लिए निम्नलिखित में से किसका उपयोग किया जाता है?

Which of the following is used to interpret and execute Java Applet Classes hosted by HTML?

[A] Appletviewer

[B] Applewatcher

[C] Appletshow

[D] Appletscreen

Correct Answer : Appletviewer


Ques 23

CTS-COPA 2024

निम्नलिखित में से कौन सा एक आदिम डेटा प्रकार नहीं है?

Which of the following is not a primitive data type ?

[A] Byte

[B] Enum

[C] Short

[D] Int

Correct Answer : Enum


Ques 24

CTS-COPA 2024

पूर्णांक डेटा प्रकार में निम्नलिखित आदिम डेटा प्रकार शामिल नहीं है ______.

Integer data type does not include following primitive data type ______.

[A] Long

[B] Byte

[C] Short

[D] double

Correct Answer : double


Ques 25

CTS-COPA 2024

__________अक्षरों का एक अनुक्रम है।

__________are a sequence of characters.

[A] Characters

[B] String

[C] Integer

[D] Classes

Correct Answer : String


Ques 26

CTS-COPA 2024

किसी वस्तु के बारे में जानकारी प्राप्त करने के लिए प्रयुक्त विधियों को __________ के रूप में जाना जाता है।

Methods used to obtain information about an object are known as __________.

[A] string method

[B] class method

[C] accessor methods

[D] object method

Correct Answer : accessor methods


Ques 27

CTS-COPA 2024

_____जावा में प्रवाह नियंत्रण कथन नहीं है।

_____is not a flow control statement in Java.

[A] Break

[B] Exit()

[C] Continue

[D] Return

Correct Answer : Exit()


Ques 28

CTS-COPA 2024

एक__________ कथन हमें एक कथन या कथनों के समूह को कई बार निष्पादित करने की अनुमति देता है।

A__________ statements allows us to execute a statement or group of statement multiple time.

[A] array

[B] loop

[C] function

[D] exception

Correct Answer : loop


Ques 29

CTS-COPA 2024

इनमें से कौन सा क्लास जावा में प्रत्येक क्लास का सुपरक्लास है?

Which of these class is superclass of every class in Java?

[A] String class

[B] Object class

[C] Abstract class

[D] Arraylist class

Correct Answer : Object class


Ques 30

CTS-COPA 2024

ऑब्जेक्ट क्लास की इनमें से कौन सी विधि किसी ऑब्जेक्ट को क्लोन कर सकती है?

Which of these method of object class can clone an object ?

[A] Objectcopy( )

[B] Copy()

[C] Object clone()

[D] Clone()

Correct Answer : Object clone()


Ques 31

CTS-COPA 2024

इनमें से कौन से कीवर्ड का उपयोग किसी क्लास की विरासत को रोकने के लिए किया जा सकता है?

Which of these keywords can be used to prevent inheritance of a class?

[A] Super

[B] Constant

[C] Class

[D] Final

Correct Answer : Final


Ques 32

I A -2011

.JAVA प्लेटफ़ॉर्म स्वतंत्र है क्योंकि

.JAVA is platform independent because

[A] It creates source file

[B] It creates object code on compilation

[C] It has different version of compiler for different hardware

[D] It used different software on different hardware

Correct Answer : It creates object code on compilation


Ques 33

I A -2011

निम्नलिखित में से कौन सी विशेषता जावा में उपलब्ध है?

Which of the following features is available in JAVA?

[A] Applets

[B] Swings

[C] Both of the above

[D] None of the above

Correct Answer : Both of the above


Ques 34

I A -2011

.JAVA C++ से भिन्न है क्योंकि

.JAVA differs from C++ because

[A] Java does not support operator overloading

[B] Java does not use pointers

[C] Java does not support global variables

[D] All of the above

Correct Answer : Java does not use pointers


Ques 35

o level July -2022

"यह" एक है:

"This" is a :

[A] Keyword

[B] Function

[C] Declaration statement

[D] Data type

Correct Answer : Keyword


Ques 36

UPSSSC JA 2023

अपाचे हाडोप फ्रेमवर्क का एक बड़ा हिस्सा ___________भाषा में लिखा गया है।

A major part of the Apache Hadoop framework is written in ___________language.

[A] C++

[B] Python

[C] JAVA

[D] R Programming

Correct Answer : JAVA


Ques 37

Hp-High court 2024

जावा भाषा का आविष्कार किसने किया?

Who invented Java language ?

[A] James Gosling

[B] Deniss Ritche

[C] Grace Hopper

[D] John Backus

Correct Answer : James Gosling


Ques 38

Programmer -2013

निम्नलिखित में से कौन सा सही है ?

Which of the following is TRUE ?

[A] In Java, an instance field declared public generates a compilation error.

[B] Int is the name of a class available in the package java.lang

[C] Instance variable names may only contain letters and digits.

[D] A class has always a constructor (possibly automatically supplied by the java compiler)

Correct Answer : A class has always a constructor (possibly automatically supplied by the java compiler)


Ques 39

Programmer -2013

जावा के संदर्भ में बाइट कोड क्या है?

What is byte code in the context of Java ?

[A] The type of code generated by a Java compiler

[B] The type of code generated by a Java Virtual Machine

[C] It is another name for a Java source file

[D] It is the code written within the instance methods of a class

Correct Answer : The type of code generated by a Java compiler


Ques 40

Programmer -2013

निम्नलिखित जावा कोड पर विचार करें

Consider the following Java code

class x{
private int a;
private int b;
public synchronized void addA(){
a++;
}
public synchronized void addB(){
b++;
}
}
Can 2 threads access the same instance of class x performing x.addA() and x.addB() at
the same time ?

[A] Yes

[B] No

[C] Yes, but sometime it may result in Runtime Exception

[D] Compile Error

Correct Answer : No


Ques 41

Programmer -2013

जावा में कौन सा वर्ग उपवर्ग नहीं हो सकता है?

In Java which class cannot be a subclass ?

[A] Abstract

[B] Parent

[C] Final

[D] None

Correct Answer : Final


Ques 42

Programmer -2013

निम्नलिखित में से कौन सा चर घोषणा जावा प्रोग्राम में संकलित नहीं किया जाएगा?

Which of the following variable declaration would not be compiled in a Java program ?

[A] int var;

[B] int VAR;

[C] int var1;

[D] int 1_var

Correct Answer : int 1_var


Ques 43

MPESB -2023

परिणामस्वरूप निम्नलिखित जावा कोड क्या उत्पन्न करेगा?

What would the following Java code produce as a result?

class String_demo1
{
public static void main(String args[])
{
char chars[] = {'x', 'y', 'x'};
String s = new String(chars);
System.out.println(s);
}
}

[A] yz

[B] xyz

[C] x

[D] z

Correct Answer : xyz


Ques 44

MPESB -2023

परिणामस्वरूप निम्नलिखित जावा कोड क्या उत्पन्न करेगा?

at would the following Java code produce as a result?

byte c = 35;
c = c * 35;

[A] c cannot include the number 35

[B] This code is error-free.

[C] The * operator changed c * 35 into an int, which cannot be translated to a byte without casting, hence there is no problem in this code.

[D] Because of the range of c, c cannot include the number 100.

Correct Answer : The * operator changed c * 35 into an int, which cannot be translated to a byte without casting, hence there is no problem in this code.


Ques 45

MPESB-2023

जावा प्रोग्राम के संकलन, परीक्षण और निष्पादन में किस उपकरण का उपयोग किया जाता है?

What tool is employed in the compilation, testing, and execution of Java programs?

[A] JRE

[B] JDK

[C] EVM

[D] EI

Correct Answer : JDK


Ques 46

MPESB-2023

निम्नलिखित जावा कोड का आउटपुट क्या होगा?

What will the following Java code produce?

class increment {
public static void main(String args[])
{ 
int z = 4;
System.out.print(++z * 8);
}
}

[A] 49

[B] 40

[C] 51

[D] 57

Correct Answer : 40


Ques 47

MPESB-2023

जावा कोड फाइल का एक्सटेंशन क्या है?

What is the extension of java code files?

[A] .js

[B] .txt

[C] .class

[D] .java

Correct Answer : .java


Ques 48

MPESB-2023

कम्‍पाईल्‍ड जावा क्लासेस का एक्सटेंशन क्या है?

What is the extension of compiled java classes?

[A] .txt

[B] .js

[C] .class

[D] .java

Correct Answer : .class


Ques 49

HPSSSB -2018

निम्नलिखित में से कौन सा जावा कोड खंड पांच पूर्णांकों की एक सरणी बनाएगा?

Which of the following Java code fragments will create an array of five integers ?

[A] int a[ ] ;a=new int(5)

[B] int a[]=[1,3,2,1,0];

[C] int a[]=new int(5);

[D] All of the above

Correct Answer : int a[]=new int(5);


Ques 50

HPSSSB -2018

जावा में शॉर्ट प्रकार के चर में संग्रहीत किया जा सकने वाला अधिकतम मान क्या है?

What is the maximum value that can be stored in a variable of type short in Java ?

[A] 65535

[B] 16767

[C] 32767

[D] 127

Correct Answer : 32767


Latest Updates