Java MCQ Questions with Answers pdf
Hello friends in this article you can find your query related to Java mcq questions with answers pdf, core java mcq questions and answers pdf, java programming questions pdf, java coding questions and answers pdf, java interview questions pdf,
Java interview questions and answers pdf, java mcq questions for interview, java interview questions for freshers, java programming question paper pdf, java viva questions and answers pdf, java questions for practice, java questions asked in interview
Java Interview Questions and Answers pdf
Core java mcq questions and answers pdf, java programming questions pdf, java coding questions and answers pdf, java interview questions pdf, java questions and answers, java questions for freshers, core java mcq pdf
Core Java MCQ Questions and Answers pdf
1. Who is known as father of Java Programming Language?
जावा प्रोग्रामिंग लैंग्वेज के पिता के रूप में किसे जाना जाता है?
- James Gosling
- Charel Babbage
- P Java
- Blais Pascal
2. What is the size of float and double in java?
जावा में फ्लोट और डबल का आकार क्या है?
- 32 and 64
- 64 and 32
- 64 and 64
- 32 and 32
3. Number of primitive data types in Java is?
जावा में primitive data प्रकारों की संख्या है?
- 6
- 7
- 8
- 9
4. Automatic type conversion is possible in which of the possible cases?
संभावित मामलों में से किसमें स्वचालित प्रकार का रूपांतरण संभव है?
- Byte to int
- Int to long
- Long to int
- Short to int
5. Select the valid statement.
मान्य कथन का चयन करें।
- char[] ch = new char()
- char[] ch = new char[5]
- char[] ch = new char(5)
- char[] ch = new char[]
6. Select the valid statement to declare and initialize an array.
Array घोषित करने और आरंभ करने के लिए मान्य कथन का चयन करें।
- int[] A = (1, 2, 3)
- int[] A = {1, 2, 3}
- int[] A = {}
- int[][] A = {1,2,3}
7. When an array is passed to a method, what does the method receive?
जब किसी method को एक array पास की जाती है, तो method को क्या प्राप्त होता है?
- The reference of the array
- Copy of first element
- Length of the array
- A copy of the array
8. Arrays in java are-
जावा में Array हैं-
- Primitive data type
- Objects
- Object references
- None
9. Identify the corrected definition of a package.
पैकेज की सही परिभाषा को पहचानें।
- A package is a collection of editing tools
- A package is a collection of interfaces
- A package is a collection of classes and interfaces
- A package is a collection of classes
10. When is the object created with new keyword?
नए कीवर्ड के साथ ऑब्जेक्ट कब बनाया जाता है?
- At run time
- Depends on the code
- At compile time
- None
Java MCQ Questions with Answers pdf
11. Identify the correct restriction on static methods.
स्थिर विधियों पर सही प्रतिबंध की पहचान करें।
- They must access only static data
- They can only call other static methods.
- They cannot refer to this or super.
- I and II
- II and III
- Only III
- I, II and III
12. In which of the following is toString() method defined?
निम्नलिखित में से किसमें toString () विधि परिभाषित है?
- lang.Object
- lang.util
- lang.String
- None
13. Identify the keyword among the following that makes a variable belong to a class, rather than being defined for each instance of the class.
निम्नलिखित में से उस कीवर्ड की पहचान करें जो एक चर को वर्ग से संबंधित बनाता है, न कि वर्ग के प्रत्येक उदाहरण के लिए परिभाषित किया जाता है।
- Volatile
- Static
- Final
- Abstract
14. compareTo() returns
compareTo() रिटर्न
- True
- False
- An int value
- None
15. What does the following string do to given string str1.
दिए गए स्ट्रिंग str1 के लिए निम्न स्ट्रिंग क्या करती है।
String str1 = “Interviewbit”.replace(‘e’,’s’);
- Replaces single occurrence of ‘s’ to ‘e’.
- Replaces all occurrences of ‘e’ to ‘s’.
- Replaces single occurrence of ‘e’ to ‘s’.
- None
16. Identify the output of the following program.
निम्नलिखित प्रोग्राम के आउटपुट को पहचानें।
String str = “abcde”;
System.out.println(str.substring(1, 3));
- bcd
- bc
- Abc
- cd
17. To which of the following does the class string belong to.
Class स्ट्रिंग निम्न में से किससे संबंधित है।
- java.lang
- java.applet
- java.awt
- java.string
18. Identify the return type of a method that does not return any value.
एक method के return प्रकार की पहचान करें जो कोई मान नहीं लौटाता है।
- double
- void
- Int
- None
19. Total constructor string class have?
कुल कंस्ट्रक्टर स्ट्रिंग क्लास है?
- 3
- 7
- 13
- 20
20. Output of Math.floor(3.6)?
Math.floor(3.6) का आउटपुट?
- 3
- 3.0
- 4
- 0
Java MCQ Questions with Answers pdf
21. Identify the modifier which cannot be used for constructor.
उस modifier की पहचान करें जिसका उपयोग कंस्ट्रक्टर के लिए नहीं किया जा सकता है।
- private
- protected
- public
- static
22. Where does the system stores parameters and local variables whenever a method is invoked?
जब भी कोई विधि लागू की जाती है तो सिस्टम पैरामीटर और स्थानीय चर कहाँ संग्रहीत करता है?
- Array
- Stack
- Heap
- Tree
23. What is the variables declared in a class for the use of all methods of the class called?
Class के सभी तरीकों के उपयोग के लिए class में घोषित variables क्या कहलाते हैं?
- Reference variable
- Instance variables
- Object
- None
24. When is the finalize() method called?
finalize() method को कब call किया जाता है?
- Before garbage collection
- Before a variable goes out of scope
- Before an object goes out of scope
- None
25. What is the implicit return type of constructor?
कंस्ट्रक्टर का निहित रिटर्न प्रकार क्या है?
- void
- A class object in which it is defined
- No return type
- None
26. Identify the prototype of the default constructor.
डिफ़ॉल्ट कंस्ट्रक्टर के प्रोटोटाइप की पहचान करें।
Public class Solution {}
- public Solution(void)
- Solution()
- Solution(void)
- public Solution()
27. Identify the infinite loop.
अनंत लूप को पहचानें।
- for(int i = 0; ;i++)
- for(int i = 0; i < 1; i–)
- for(; ; )
- All of the above
28. Identify the correct way of declaring constructor.
कंस्ट्रक्टर घोषित करने का सही तरीका पहचानें।
Public class Solution {}
- Solution(void){}
- public Solution(){}
- Solution(){}
- Both (A) and (B)
29. What is Runnable?
रननेबल क्या है?
- Class
- Interface
- Abstract class
- Method
30. Which of the following exception is thrown when divided by zero statement is executed?
निम्नलिखित में से कौन सा exception तब फेंका जाता है जब divided by zero कथन execute किया जाता है?
- NumberFormatException
- NullPointerException
- ArithmeticException
- None
Java MCQ Questions with Answers pdf
31. Excepted created by try block is caught in which block.
ट्राई ब्लॉक द्वारा बनाया गया “एक्सेप्टेड” किस ब्लॉक में पकड़ा जाता है।
- catch
- final
- throw
- none
32. Where is System class defined?
सिस्टम क्लास को कहां परिभाषित किया गया है?
- java.lang.package
- java.io.package
- java.util.package
- None
33. Which of the following statements are true about finalize() method?
Finalize() method के बारे में निम्नलिखित में से कौन सा कथन सत्य है?
- It can be called Zero or one times
- It can be called Exactly once
- It can be called Zero or more times
- It can be called One or more times
34. Identify the interface which is used to declare core methods in java?
उस इंटरफ़ेस की पहचान करें जिसका उपयोग जावा में मुख्य विधियों को घोषित करने के लिए किया जाता है?
- Set
- EventListener
- Comparator
- Collection
35. What does the operator >>>> do?
ऑपरेटर >>>> क्या करता है?
- Zero fill left shift
- Left shift operator
- Right shift operator
- Zero fill right shift
36. Which of the following is used to find and fix bugs in the program?
प्रोग्राम में बग को खोजने और ठीक करने के लिए निम्न में से किसका उपयोग किया जाता है?
- JVM
- JRE
- JDK
- JDB
37. Identify the incorrect Java feature.
गलत जावा feature की पहचान करें।
- Dynamic
- Use of pointers
- Object oriented
- Architectural neural
38. Which of these components are used in a Java program for compilation, debugging, and execution?
जावा प्रोग्राम में compilation, debugging और execution के लिए इनमें से कौन से घटक का उपयोग किया जाता है?
- JDK
- JRE
- JVM
- JIT
39. What is BigDecimal.ONE?
BigDecimal.ONE क्या है?
- it is a custom-defined statement
- it is a wrong statement
- it is a static variable that has a value of 1 on a scale of 0
- it is a static variable that has a value of 1 on a scale of 10
40. Which of these literals can be contained in a float data type variable?
इनमें से कौन सा अक्षर एक फ्लोट डेटा प्रकार चर में समाहित किया जा सकता है?
- -3.4e+050
- -1.7e+308
- -3.4e+038
- +1.7e+308
Java MCQ Questions with Answers pdf
41. When an expression consists of int, double, long, float, then the entire expression will get promoted into a data type that is:
जब एक एक्सप्रेशन में int, double, long, float होता है, तो पूरे एक्सप्रेशन को डेटा टाइप में promote किया जाएगा जो है:
- int
- double
- float
- long
42. Out of these statements, which ones are incorrect?
इन कथनों में से कौन-से कथन गलत हैं?
- The addition operator + and the subtraction operator – have an equal precedence
- The equal to = operator has the lowest precedence
- The Brackets () have the highest precedence
- The division operator / has comparatively higher precedence as compared to a multiplication operator
43. Which of the following operators can operate on a boolean variable?
निम्नलिखित में से कौन सा ऑपरेटर बूलियन वैरिएबल पर काम कर सकता है?
A. &&
B. ==
C. ?:
D. +=
- C & B
- A & D
- A, B & D
- A, B & C
44. What will be the output of the following Java code snippet?
निम्नलिखित जावा कोड स्निपेट का आउटपुट क्या होगा?
class P
{
}
enum Enums extends P
{
PQR, QRS, RST, STU;
}
- Compilation Error
- It runs successfully
- EnumNotDefined Exception
- Runtime Error
45. What is it called when the child object also gets killed when the parent object is killed in the program?
प्रोग्राम में पैरेंट ऑब्जेक्ट के मारे जाने पर चाइल्ड ऑब्जेक्ट भी मारे जाने पर इसे क्या कहा जाता है?
- Aggregation
- Association
- Encapsulation
- Composition
46. When does Overloading not occur?
ओवरलोडिंग कब नहीं होती है?
- When more than a single method have the same name, yet different types or number of parameters and different method signature
- When more than a single method have the same signature, same name, and the same number of parameters have different types
- When more than a single method have the same name, the same signature, but have different numbers of signature
- When more than a single method have the same name, the same number and types of parameters, and yet different signatures
47. How does one identify if a compilation unit is an interface or class from a .class file?
एक .class फ़ाइल से एक संकलन इकाई एक इंटरफ़ेस या वर्ग है या नहीं, इसकी पहचान कैसे की जाती है?
- Extension of the compilation unit
- Java source file header
- The class and interface cannot be differentiated
- The unit type must be used to postfix interface or class name
48. What would happen to the thread whenever the garbage collection kicks off?
जब भी garbage collection शुरू होता है तो thread का क्या होगा?
- The garbage collection and the thread don’t interfere with each other
- The thread would continue its operation
- The garbage collection won’t happen until the running of the thread
- The thread would be paused while the running of the garbage collection
49. Out of these methods of the String class, which one can be used for testing the strings for equality?
स्ट्रिंग क्लास की इन विधियों में से, समानता के लिए स्ट्रिंग्स के परीक्षण के लिए किसका उपयोग किया जा सकता है?
- isequals()
- equal()
- equals()
- isequal()
50. Out of these, which one is the correct way of calling a constructor that has no parameters of the superclass A by the subclass B?
इनमें से कौन सा एक ऐसे कंस्ट्रक्टर को कॉल करने का सही तरीका है जिसमें उपवर्ग B द्वारा सुपरक्लास A का कोई पैरामीटर नहीं है?
- super(void);
- superA();
- super();
- superclass();
Also Read: Java MCQ Questions and Answers pdf in Hindi English
51. Out of these packages, which one contains an abstract keyword?
इन पैकेजों में से किसमें एक अमूर्त कीवर्ड है?
- java.system
- java.lang
- java.util
- java.io
52. Out of these methods of the Object class, which one can clone an object?
ऑब्जेक्ट क्लास के इन तरीकों में से कौन किसी ऑब्जेक्ट को क्लोन कर सकता है?
- Object clone()
- copy()
- Object copy()
- clone()
53. Out of these methods, which one can be used for converting all the characters present in a String into an Array of characters?
इन विधियों में से किसका उपयोग स्ट्रिंग में मौजूद सभी वर्णों को वर्णों की एक सरणी में परिवर्तित करने के लिए किया जा सकता है?
- both getChars() & toCharArray()
- charAt()
- both charAt() & getChars()
- all of the mentioned
54. Out of these exceptions, which one is thrown by the compareTo() method that is defined in a double wrapper?
इन exceptions में से, कौन सा एक double wrapper में परिभाषित compareTo() method द्वारा फेंका गया है?
- IOException
- ClassCastException
- SystemException
- CastException
55. What value is returned by the compareTo() function in case the invoking string happens to be greater than the compared string?
यदि इनवोकिंग स्ट्रिंग, तुलना की गई स्ट्रिंग से अधिक होती है, तो तुलना करने के लिए () फ़ंक्शन द्वारा क्या मान लौटाया जाता है?
- zero
- a value that is less than zero
- a value that is greater than zero
- none of the above
56. Where does the String Pool get stored?
स्ट्रिंग पूल कहाँ संग्रहीत किया जाता है?
- Metaspace
- Permanent Generation
- Java Heap
- Java Stack
57. Out of these methods, which one makes the raw MIME formatted string?
इन विधियों में से कौन raw MIME स्वरूपित स्ट्रिंग बनाता है?
- toString()
- parseString()
- parse()
- getString()
58. Out of these data members of the HttpResponse class, which one is used for the storage of the response that is from an http server?
HttpResponse वर्ग के इन डेटा सदस्यों में से किसका उपयोग http सर्वर से प्राप्त प्रतिक्रिया के भंडारण के लिए किया जाता है?
- address
- statusResponse
- statusCode
- status
59. The remover() method throws which of these exceptions:
रिमूवर () विधि इनमें से कौन सा अपवाद फेंकता है:
- IOException
- IllegalStateException
- ObjectNotFoundException
- SystemException
60. What happens when we call two threads that have the same priority to process simultaneously?
क्या होता है जब हम दो थ्रेड्स को कॉल करते हैं जिनकी एक साथ प्रोसेस करने की प्राथमिकता समान होती है?
- Both of the threads will be simultaneouslyexecuted
- There will be no execution of threads
- Itdepends on the OS
- Any one of the threads can be executed first lexicographically
Java MCQ Questions with Answers pdf
61. Out of the following, which one is a superclass of all the exception type classes?
निम्नलिखित में से कौन-सा एक अपवाद प्रकार के सभी वर्गों का सुपरक्लास है?
- String
- Catchable
- RuntimeExceptions
- Throwable
62. Out of these classes, which one is used for reading strings and characters in Java from the console?
इन classes में से किसका उपयोग जावा में कंसोल से स्ट्रिंग्स और कैरेक्टर पढ़ने के लिए किया जाता है?
- InputStreamReader
- BufferedReader
- StringReader
- BufferedStreamReader
63. Out of these classes, which one allows a user to define their own formatting pattern for time and dates?
इन वर्गों में से कौन सा एक उपयोगकर्ता को समय और तिथियों के लिए अपने स्वयं के स्वरूपण पैटर्न को परिभाषित करने की अनुमति देता है?
- UsersDateFormat
- ComplexDateFormat
- SimpleDateFormat
- DefinedDateFormat
64. Out of these operators, which one can be used to get the run time info about an object?
इन ऑपरेटरों में से, किसी वस्तु के बारे में रन टाइम की जानकारी प्राप्त करने के लिए किसका उपयोग किया जा सकता है?
- getinfoof
- getInfo
- Info
- instanceof
65. Which method can we use in an applet to output a string?
एक स्ट्रिंग को आउटपुट करने के लिए हम एप्लेट में किस विधि का उपयोग कर सकते हैं?
- transient()
- drawString()
- display()
- print()
66. Which one is a superclass of the ContainerEvent class out of the following?
निम्नलिखित में से कौन सा कंटेनरएवेंट क्लास का सुपरक्लास है?
- ComponentEvent
- ItemEvent
- InputEvent
- WindowEvent
67. The public int start() returns what?
सार्वजनिक int start() क्या लौटाता है?
- the start index of the previous match
- the start index of the input string
- the start index of the current match
- None of the above
68. _______ is a superclass of all the Adapter classes.
_______ सभी एडेप्टर वर्गों का एक सुपरक्लास है।
- InputEvent
- Applet
- ComponentEvent
- Event
69. Which class produces objects with respect to their geographical locations?
कौन सा वर्ग वस्तुओं को उनके भौगोलिक स्थानों के संबंध में उत्पन्न करता है?
- Simple TimeZone
- Date
- Locale
- TimeZone
70. Which method in Java generates boolean random values?
जावा में कौन सी विधि बूलियन यादृच्छिक मान उत्पन्न करती है?
- generateBoolean()
- nextBoolean()
- randomBoolean()
- previousBoolean()
Java MCQ Questions with Answers pdf
71. Which method is used for notifying the observer about the change in the observed object?
प्रेक्षित वस्तु में परिवर्तन के बारे में प्रेक्षक को सूचित करने के लिए किस विधि का उपयोग किया जाता है?
- observed()
- update()
- notify()
- check()
72. What are the uses of generics?
जेनरिक के उपयोग क्या हैं?
- The generics add stability to a code. They do so by making more bugs detectable at the runtime
- The generics make a code faster
- The generics make a code more readable and optimised
- The generics add stability to a code. They do so by making more bugs detectable at the compile time
73. Which package is used to remotely invoke a method?
किसी विधि को दूरस्थ रूप से लागू करने के लिए किस पैकेज का उपयोग किया जाता है?
- java.applet
- java.rmi
- java.awt
- java.util
74. Which mechanism helps in the process of naming as well as visibility control of the classes and their content?
कक्षाओं और उनकी सामग्री के नामकरण के साथ-साथ दृश्यता नियंत्रण की प्रक्रिया में कौन सा तंत्र मदद करता है?
- Packages
- Object
- Interfaces
- None of the above
75. The primary use of Files.lines(Path path) is that it:
Files.lines(Path path) का प्राथमिक उपयोग यह है कि:
- reads the lines that are from a file as the Stream
- counts the total number of lines for the files at the specified path
- reads the filenames at the specified path
- reads the files that are at the path specified as the String
76. The configuration is stored in which of the file database tables:
कॉन्फ़िगरेशन को किस फ़ाइल डेटाबेस तालिका में संग्रहीत किया जाता है:
- .sql
- .dbm
- .hbm
- .ora
77. Which keywords for the purpose of upper bound a wildcard?
वाइल्डकार्ड के ऊपरी हिस्से के लिए कौन से कीवर्ड हैं?
- bound
- implements
- stop
- extends
78. What does the abbreviation MVC pattern stand for?
संक्षिप्त नाम “एमवीसी” पैटर्न का क्या अर्थ है?
- Model View Class
- Mock View Controller
- Mock View Class
- Model View Control
79. Out of the following statements, which one is not true about the Java beans?
निम्नलिखित में से कौन सा कथन जावा बीन्स के बारे में सही नहीं है?
- It extends the java.io.Serializable class
- It provides getter and setter methods for its properties
- It implements the java.io.Serializable interface
- It provides us with no argument constructor
80. The advantage of using the PreparedStatement in Java is:
जावा में ” PreparedStatement ” का उपयोग करने का लाभ है:
- Encourages SQL injection
- Prevents SQL injection
- More memory usage
- Slow performance
Java MCQ Questions with Answers pdf
81. What would happen if the IP Address of the host can’t be determined?
- IOException is thrown
- Temporary IP Address will be assigned
- The system will exit with no message
- UnknownHostException is thrown
82. How does one move from some desired step to another one?
कोई वांछित कदम से दूसरे कदम पर कैसे जाता है?
- logger.error
- System.out.println
- logger.log
- breakpoints
83. The storage capacity of a single cookie is:
एक कुकी की भंडारण क्षमता है:
- 2048 bytes
- 4095 bytes
- 4095 MegaBytes
- 2048 MegaBytes
84. ______ file defines dependency in maven.
______ फ़ाइल मावेन में निर्भरता को परिभाषित करती है।
- dependency.xml
- version.xml
- build.xml
- pom.xml
85. Which action variable helps in including a file in the JSP?
जेएसपी में फाइल को शामिल करने में कौन सा एक्शन वेरिएबल मदद करता है?
- jsp:getProperty
- jsp:include
- jsp:plugin
- jsp:setProperty
86. The main difference between AutoCloseable and Closeable is that:
AutoCloseable और Closeable के बीच मुख्य अंतर यह है कि:
- AutoCloseable throws IOException; Closeable throws Exception
- AutoCloseable is a concrete class and Closeable is an interface
- AutoCloseable throws Exception; Closeable throws IOException
- AutoCloseable is an implementation; Closeable is a concept
87. In java control statements break, continue, return, try-catch-finally and assert belongs to?
जावा कंट्रोल स्टेटमेंट में ब्रेक, जारी, रिटर्न, ट्राई-कैच-आखिरकार और एस्टर का संबंध है?
- Selection statements
- Pause Statement
- Transfer statements
- Loop Statements
88. What is byte code in Java?
जावा में बाइट कोड क्या है?
- Code generated by a Java compiler
- Name of Java source code file
- Code generated by a Java Virtual Machine
- Block of code written inside a class
89. Which provides runtime environment for java byte code to be executed?
जो जावा बाइट कोड को निष्पादित करने के लिए रनटाइम वातावरण प्रदान करता है?
- JRE
- JVM
- JDK
- JAVAC
90. Which of the following are not Java keywords?
निम्नलिखित में से कौन जावा कीवर्ड नहीं हैं?
- Double
- Instanceof
- Then
- Switch
So friends I hope you enjoy this article related to java mcq questions with answers pdf, java coding questions and answers pdf, java interview questions and answers pdf, java mcq questions for interview, java programming question paper pdf
Java Interview Questions and Answers pdf
File Name | Java MCQ Questions with Answers pdf |
File Size | 862 KB |
No. of Pages | 19 |
Language | Hindi and English |
Download | Click Here |
Related Searches: java mcq questions with answers pdf, core java mcq questions and answers pdf, java coding questions and answers pdf, java viva questions and answers pdf, java questions for practice, java questions and answers in hindi english, java questions for freshers