पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 10 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
Java में goto पर रोक क्यों है, और const की जगह क्या रखा गया है?
Why is goto banned in Java, and what was put in place of const?
Agoto धीमा चलता था; const की जगह staticgoto ran slowly; static in place of const
Bgoto का नाम बदल गया; const की जगह enumgoto was renamed; enum in place of const
Cgoto अब भी चलता है; const हटा दिया गयाgoto still works; const was removed
Dपुरानी भाषाओं में goto से कई समस्याएँ बनीं; const की जगह finalgoto created several problems in older languages; final in place of const
सही उत्तर / Answer: (D)
हल / Solution
पाठ की श्रेणी viii यही बताती है — «Usage of goto created several problems in old languages and hence goto keyword is banned in java», और const के बारे में «use of final instead of const»। दोनों unused keyword हैं: reserved तो हैं, पर इस्तेमाल करने पर compile time error मिलती है, सो उन्हें identifier भी नहीं बनाया जा सकता।
Category viii of the text states exactly this — 'usage of goto created several problems in old languages and hence the goto keyword is banned in java', and of const, 'use of final instead of const'. Both are unused keywords: they are reserved, yet using them gives a compile time error, so they cannot be made identifiers either.
प्रश्न 2उत्तर + हल
class से जुड़ी keyword की संख्या कितनी है?
How many class related keywords are there?
AचारFour
BछहSix
CआठEight
Dग्यारहEleven
सही उत्तर / Answer: (B)
हल / Solution
पाठ की श्रेणी v के अनुसार class से जुड़ी छह keyword हैं — class, interface, extends, implements, package और import। बाक़ी श्रेणियाँ: data type 8, flow control 11, modifier 11, exception handling 6, object से जुड़ी 4, void 1, unused 2 और enum 1 — इन नौ का जोड़ 50 keyword, और उनमें 3 reserved literal मिलाकर कुल 53 reserved words बनते हैं।
By category v of the text there are six class related keywords — class, interface, extends, implements, package and import. The remaining categories run: data types 8, flow control 11, modifiers 11, exception handling 6, object related 4, void 1, unused 2 and enum 1 — these nine add to 50 keywords, and with the 3 reserved literals they make 53 reserved words in all.
प्रश्न 3उत्तर + हल
object से जुड़ी keyword कौन-कौन हैं?
Which are the object related keywords?
Anew, instanceof, super, this
Bclass, interface, extends, implements
Ctry, catch, finally, throw
Dpublic, private, protected, static
सही उत्तर / Answer: (A)
हल / Solution
पाठ की श्रेणी vi के अनुसार object से जुड़ी चार keyword हैं — new, instanceof, super, this। बाक़ी तीनों सूचियाँ दूसरी श्रेणियों की हैं: class से जुड़ी छह(class, interface, extends, implements, package, import), exception handling की छह(try, catch, finally, throw, throws, assert)और modifier की ग्यारह। श्रेणियों की यह गिनती जोड़कर ही 53 reserved words बनते हैं।
By category vi of the text there are four object related keywords — new, instanceof, super, this. The other three lists belong to different categories: six class related ones (class, interface, extends, implements, package, import), six for exception handling (try, catch, finally, throw, throws, assert) and eleven modifiers. Adding up these category counts is what gives the 53 reserved words.
प्रश्न 4उत्तर + हल
enum keyword किस JDK संस्करण में जोड़ी गई?
In which JDK version was the enum keyword added?
AJDK 1.2
BJDK 1.4
CJDK 1.5
DJDK 1.0
सही उत्तर / Answer: (C)
हल / Solution
पाठ enum के साथ JDK 1.5 लिखता है, और उसी से named constant का समूह बनाया जाता है — जैसे «enum month{Jan, Feb, Mar…}»। तुलना के लिए: strictfp JDK 1.2 में और assert JDK 1.4 में जुड़ी थीं। ये तीनों बाद में जुड़ी keyword हैं, और इसी वजह से 53 reserved words की गिनती समय के साथ बढ़ी है।
The text writes JDK 1.5 beside enum, and it is used to define a group of named constants — as in 'enum month{Jan, Feb, Mar…}'. For comparison: strictfp was added in JDK 1.2 and assert in JDK 1.4. These three are keywords added later, and this is why the count of 53 reserved words has grown over time.
प्रश्न 5उत्तर + हल
Java में return type के बारे में क्या सही है, और C language से यह कैसे अलग है?
What is true of the return type in Java, and how does it differ from C?
AJava में अनिवार्य; C में optional और डिफ़ॉल्ट integerMandatory in Java; optional in C with integer as default
BJava में optional; C में अनिवार्यOptional in Java; mandatory in C
Cदोनों में optionalOptional in both
Dदोनों में अनिवार्यMandatory in both
सही उत्तर / Answer: (A)
हल / Solution
पाठ के शब्दों में — Java में return type अनिवार्य है, और यदि कोई method कुछ return नहीं करता तो उसे void return type के साथ declare करना होगा। C language में return type optional है और न लिखने पर डिफ़ॉल्ट integer मान लिया जाता है। इसी वजह से void को Java में अपनी अलग श्रेणी «void return type keyword» की इकलौती keyword के रूप में गिना गया है।
In the text's words — in Java the return type is mandatory, and if a method returns nothing it must be declared with the void return type. In C the return type is optional, and when omitted the default is taken to be integer. For this very reason void is counted in Java as the sole keyword of its own category, the 'void return type keyword'.
प्रश्न 6उत्तर + हल
सभी अवैध Java keyword खोजिए।
Find all invalid Java keywords?
Athrows
Bthrown
Cthrough
Dदोनों thrown और throughBoth thrown and through
सही उत्तर / Answer: (D)
हल / Solution
throws exception handling की छह keyword में से एक है — try, catch, finally, throw, throws और assert। thrown Java में उपलब्ध ही नहीं, और through कोई keyword नहीं, सो दोनों अवैध हैं। theory का उदाहरण भी «throw, throws, thrown (invalid)» के साथ यही बताता है और जोड़ता है कि thrown Java में मौजूद नहीं है। यही वर्तनी की सख़्ती बार-बार परखी जाती है।
throws is one of the six exception handling keywords — try, catch, finally, throw, throws and assert. thrown is not available in Java at all, and through is no keyword, so both are invalid. The theory's example says the same with 'throw, throws, thrown (invalid)' and adds that thrown is not present in Java. This strictness over spelling is what gets tested again and again.
प्रश्न 7उत्तर + हल
जावा प्रोग्रामिंग भाषा में निम्नलिखित में से कौन आरक्षित शब्द है?
Which is a reserved word in the Java programming language?
Amethod
Bnative
Csubclasses
Dreference
सही उत्तर / Answer: (B)
हल / Solution
native जावा का आरक्षित शब्द है। किसी विधि पर लगाने से वह बताता है कि उसका शरीर जावा में नहीं, सी या सी++ जैसी मूल भाषा में लिखा है और जावा नेटिव इंटरफ़ेस (JNI) से जुड़ता है; ऐसी विधि के आगे शरीर नहीं, सीधे अर्धविराम आता है। method, subclasses और reference जावा की चर्चा में काम आने वाले शब्द हैं, कीवर्ड नहीं — इन्हें चर या विधि का नाम बनाया जा सकता है।
native is a reserved word in Java. Placed on a method, it says that the body of that method is written not in Java but in a language such as C, and is linked in through the Java Native Interface. Such a method has no body, only a semicolon. The words method, subclasses and reference belong to the vocabulary used while talking about Java, but they are not keywords, so they may serve as ordinary names.
प्रश्न 8उत्तर + हल
इनमें से किस सूची में केवल जावा प्रोग्रामिंग भाषा के कीवर्ड हैं?
Which one of these lists contains only Java programming language keywords?
दूसरी सूची के सभी छह शब्द कीवर्ड हैं — goto अप्रयुक्त कीवर्ड है, instanceof संकारक, native मूल भाषा में लिखी विधि के लिए, finally अपवाद वाले खंड के लिए, default switch और इंटरफ़ेस में, तथा throws विधि के शीर्ष में। पहली सूची में Int बड़े I से लिखा है, तीसरी में virtual सी++ का शब्द है, और चौथी में constant जावा में कहीं नहीं है। इसलिए दूसरा विकल्प सही है।
Every one of the six words in the second list is a keyword: goto is an unused keyword, instanceof is an operator, native marks a method written in another language, finally belongs to exception handling, default is used in a switch and in interfaces, and throws appears in a method header. The first list has Int with a capital I, the third has virtual from C++, and the fourth has constant, which Java never defined.
प्रश्न 9उत्तर + हल
जावा में निम्नलिखित में से कौन अप्रयुक्त (unused) कीवर्ड हैं?
In Java, which of the following are unused keywords?
Aconst
Bgoto
C(a) और (b) दोनोंBoth (a) & (b)
Dइनमें से कोई नहींNone of these
सही उत्तर / Answer: (C)
हल / Solution
const और goto दोनों जावा की कीवर्ड सूची में हैं, पर भाषा में इनका कोई काम नहीं। इन्हें आरक्षित सिर्फ़ इसलिए रखा गया कि सी और सी++ से आने वाला प्रोग्रामर इन्हें ग़लती से चर का नाम न बना ले और उसे साफ़ त्रुटि मिले। इन्हीं को अप्रयुक्त कीवर्ड कहते हैं। जावा में स्थिरांक के लिए final और छलाँग के बदले लेबल वाला break इस्तेमाल होता है, इसलिए तीसरा विकल्प सही है।
const and goto both appear in the Java keyword list, yet the language gives them no meaning. They were reserved only so that a programmer coming from C or C++ could not use them as names by mistake and would get a clear error instead. They are called unused or reserved keywords. Java uses final for a constant and a labelled break in place of a jump, so option 3 is correct.
प्रश्न 10उत्तर + हल
निम्नलिखित में से कौन जावा का आरक्षित कीवर्ड है?
Which of the following is a reserved keyword in Java?
Aobject
Bstrictfp
Cmain
Dsystem
सही उत्तर / Answer: (B)
हल / Solution
strictfp जावा का कीवर्ड है। क्लास या विधि पर लगाने से दशमलव गणना (floating point) हर मशीन पर IEEE 754 के अनुसार एक ही नतीजा देती है। बाक़ी तीन कीवर्ड नहीं हैं — Object और System असल में java.lang पैकेज की क्लास हैं और बड़े अक्षर से लिखी जाती हैं, जबकि main सिर्फ़ उस विधि का नाम है जहाँ से प्रोग्राम चलना शुरू होता है। क्लास या विधि का नाम कीवर्ड नहीं होता।
strictfp is a genuine Java keyword. Applied to a class or a method, it makes floating point arithmetic follow IEEE 754 so that the result is the same on every machine. The other three are not keywords. Object and System are classes in the java.lang package and are written with a capital letter, while main is only the name of the method where execution begins. A class name is never a keyword.
आगे के 10 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति