Java Multiple Choice Questions And Answers Here is a list of 60 core java and advanced java mcq questions and answers for freshers. + Multiple Choice Questions & Answers in Java with explanations – Every MCQ set focuses on a specific topic in Java Subject. Who should Practice these. Java Programming questions and answers with explanation for interview, competitive examination and entrance test. Fully solved examples with detailed.
|Language:||English, Spanish, Hindi|
|Genre:||Academic & Education|
|ePub File Size:||28.62 MB|
|PDF File Size:||16.63 MB|
|Distribution:||Free* [*Sign up for free]|
Core Java objective type questions with answers and explanation (MCQs) for job interview and placement tests. This Core Java online test is useful for. Java Multiple Choice Questions. Dept of Computer Science .. 22) Which of the following features are common to both Java & C++?. portal7.info class declaration b. Java Programming questions and answers with explanation for interview, competitive download Java Programming quiz questions with answers as PDF files and eBooks. Interview Questions and Answers (objective type, multiple choice)?.
A d 44 The blank space in the following sentence has to be correctly filled : Members of a class specified as ……………….. A d 45 Java compiler javac translates Java source code into ……………………… a Assembler language b Byte code c Bit code d Machine code e Platform dependent code. A b 48 In Java, a try block should immediately be followed by one or more ……………….. A d 49 An abstract data type typically comprises a …………… and a set of ……………… respectively. A e 50 In object-oriented programming, the process by which one object acquires the properties of another object is called a Encapsulation b Polymorphism c Overloading d Inheritance e Overriding. A c 53 Consider the following statements about Java packages: I.
Which of these is an incorrect Statement? Arrays Questions and Answers 5. Which of these is necessary to specify at time of array initialization? Collections Questions and Answers 1.
Which of these packages contain all the collection classes? Collections Questions and Answers 2. Collections Questions and Answers 3. Collections Questions and Answers 4.
Which of these methods deletes all the elements from invoking collection? Collections Questions and Answers 5. What is Collection in Java? When does Exceptions in Java arises in code sequence? Which of these keywords is not a part of exception handling?
Which of these keywords must be used to monitor for exceptions?
Which of these keywords must be used to handle the exception thrown by try block in some rational manner? Which of these keywords is used to manually throw an exception? Input Output Streams Questions and Answers 1. Input Output Streams Questions and Answers 2. Input Output Streams Questions and Answers 3.
Which of these is a type of stream in Java? Input Output Streams Questions and Answers 4. Which of these classes are used by Byte streams for input and output operation?
Input Output Streams Questions and Answers 5. Which of these classes are used by character streams for input and output operations?
Which of these keywords is used to define interfaces in Java? Which of these can be used to fully abstract a class from its implementation? Which of these access specifiers can be used for an interface? Which of these keywords is used by a class to use an interface defined previously? Which of the following is correct way of implementing an interface salary by class manager?
Which of these class is not a member class of java. Which of these interface is not a member of java. Which of these class is not related to input and output stream in terms of functioning? Which of these is specified by a File object? Which of these classes is not included in java.
Which of these is a process of converting a simple data type into a class? Which of these is wrapper for simple data type float?
Which of the following is method of wrapper Float for converting the value of an object into byte? Which of these standard collection classes implements a dynamic array? Which of these class can generate an array which can increase and decrease in size automatically? Which of these method can be used to increase the capacity of ArrayList object manually?
Which of these method of ArrayList class is used to obtain present size of an object? Which of these methods can be used to obtain a static array from an ArrayList object?
Packages Questions and Answers 1. Which of these keywords is used to define packages in Java? Packages Questions and Answers 2. Which of these is a mechanism for naming and visibility control of a class and its content?
Packages Questions and Answers 3. Which of this access specifies can be used for a class so that its members can be accessed by a different class in the same package?
Packages Questions and Answers 4. Packages Questions and Answers 5. Many types: Class Method Area: Class Area stores per-class structures such as the runtime constant pool, field, method data, and the code for methods.
Heap: It is the runtime data area in which the memory is allocated to the objects Stack: Java Stack stores frames. It holds local variables and partial results, and plays a part in method invocation and return. Each thread has a private JVM stack, created at the same time as the thread. A new frame is created each time a method is invoked.
A frame is destroyed when its method invocation completes.
Program Counter Register: PC program counter register contains the address of the Java virtual machine instruction currently being executed. Native Method Stack: It contains all the native methods used in the application. More Details. JIT compiles parts of the bytecode that have similar functionality at the same time, and hence reduces the amount of time needed for compilation.
A platform is the hardware or software environment in which a piece of software is executed. There are two types of platforms, software-based and hardware-based. Java provides the software-based platform. There are the following differences between the Java platform and other platforms.
Java is the software-based platform whereas other platforms may be the hardware platforms or software-based platforms. Java is executed on the top of other hardware platforms whereas other platforms can only have the hardware components. The bytecode. Java compiler converts the Java programs into the class file Byte Code which is the intermediate language between source code and machine code.
This bytecode is not platform specific and can be executed on any computer. Classloader is a subsystem of JVM which is used to load class files.
Whenever we run the java program, it is loaded first by the classloader. There are three built-in classloaders in Java. Bootstrap ClassLoader: This is the first classloader which is the superclass of Extension classloader.
It loads the rt. Extension ClassLoader: This is the child classloader of Bootstrap and parent classloader of System classloader.
It loads the class files from the classpath. By default, the classpath is set to the current directory. You can change the classpath using "-cp" or "-classpath" switch. It is also known as Application classloader. Yes, Java allows to save our java file by. It is empty, but not null. The program compiles and runs correctly because the order of specifiers doesn't matter in Java.
The local variables are not initialized to any default value, neither primitives nor object references. In Java, access specifiers are the keywords which are used to define the access scope of the method, class, or a variable. In Java, there are four access specifiers given below. Public The classes, methods, or variables which are defined as public, can be accessed by any class or method.
Protected Protected can be accessed by the class of the same package, or by the sub-class of this class, or within the same class. Default Default are accessible within the package only. By default, all the classes, methods, and variables are of default scope. Private The private class, methods, or variables defined as private can be accessed within the class only. The methods or variables defined as static are shared among all the objects of the class.
The static is the part of the class and not of the object. The static variables are stored in the class area, and we do not need to create the object to access such variables.
Therefore, static is used in the case, where we need to define variables or methods which are common to all the objects of the class. For example, In the class simulating the collection of the students in a college, the name of the college is the common attribute to all the students.
Therefore, the college name will be defined as static. There are various advantages of defining packages in Java. Packages avoid the name clashes.