Kainjan Welcomes U All – Enjoy everyday



((MARKS)) (1/2/3...)1((QUESTION))Which of the following is not the feature of OOPs?((OPTION_A))Data Encapsulation((OPTION_B))Inheritance((OPTION_C))Polymorphism((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)Class, object, encapsulation, inheritance, polymorphism, data hiding, abstraction are all features of object oriented programmingSinhgad Institute of TechnologyDepartment of Computer EngineeringSubject-PPL(210254)MCQ- Unit-4 Java as object oriented programming Language-Overview((MARKS)) (1/2/3...)1((QUESTION))The wrapping up of data and functions into a single unit is((OPTION_A))Data Abstraction((OPTION_B))Data Encapsulation((OPTION_C))Both (a) & (b)((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Data encapsulation is nothing but keeping data and functions together((MARKS)) (1/2/3...)1((QUESTION))Which of the following feature supports reusability and extensibility of classes?((OPTION_A))Inheritance((OPTION_B))Overloading((OPTION_C))Polymorphism((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)Inheritance is mainly used for extension and reusability.((MARKS)) (1/2/3...)1((QUESTION))________ is the ability for a message or data to be processed in more than one form.((OPTION_A))Class((OPTION_B))Abstraction((OPTION_C))Polymorphism((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Polymorphism is nothing but ability to take more than one form.((MARKS)) (1/2/3...)1((QUESTION))Which of the following features of procedure oriented programming is false((OPTION_A))Large programs are divided into small or unitscalled functions.((OPTION_B))Employs bottom-up approach in program design.((OPTION_C))Most of the functions share global data.((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Procedure oriented programming uses top down hierarchy.((MARKS)) (1/2/3...)1((QUESTION))Which of the following features of object oriented programming is false?((OPTION_A))Data is hidden and is not available to externalfunctions.((OPTION_B))New data and functions can be added easily..((OPTION_C))Objects may communicate with each otherthrough functions.((OPTION_D))Emphasis is on the procedure rather than data((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)In object oriented programming emphasis is on data.((MARKS)) (1/2/3...)1((QUESTION))________Provides a value for a variable((OPTION_A))Declaration statement((OPTION_B))Assignment statement((OPTION_C))Definition statement((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Declaration just reserve memory whereas assignment actually allocates memory to variable.((MARKS)) (1/2/3...)1((QUESTION))The operator ?: is((OPTION_A))Logical operator((OPTION_B))Relational operator((OPTION_C))Conditional operator((OPTION_D))Arithmetic operator((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)?: acts as ternary operator((MARKS)) (1/2/3...)1((QUESTION))The following statement forces the next iteration of the loop to take place((OPTION_A))Break((OPTION_B))Continue((OPTION_C))Goto((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Break stops execution of iteration whereas continue goes to next loop((MARKS)) (1/2/3...)1((QUESTION))Java is((OPTION_A))Procedural programming language((OPTION_B))Structural programming language((OPTION_C))Object oriented programming language((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Java and C++ is object oriented whereas C is procedure oriented language((MARKS)) (1/2/3...)1((QUESTION))An entity representing some characteristics and behavior is((OPTION_A))object((OPTION_B))Function((OPTION_C))Method((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)Class create template for object whereas object is actual entity.((MARKS)) (1/2/3...)1((QUESTION))Which of the following is considered as platform independentcode?((OPTION_A))Source Code((OPTION_B))Compiled code((OPTION_C))((OPTION_D))((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java is called as platform independent language((OPTION_A))True((OPTION_B))False((OPTION_C))((OPTION_D))((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java has ______ primtive types of data.((OPTION_A))4((OPTION_B))5((OPTION_C))8((OPTION_D))7((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))In order to fetch stream of data from network of file, followingdata type is used _______.((OPTION_A))int((OPTION_B))byte((OPTION_C))char((OPTION_D))double((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))The name of the class file is created automatically when youcompile the program with the javac command.((OPTION_A))True((OPTION_B))False((OPTION_C))((OPTION_D))((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))JVM will differ from platform to platform but still all understandthe Same Java Bytecode((OPTION_A))True((OPTION_B))False((OPTION_C))((OPTION_D))((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Following example of Nested Comments is allowed in JavaProgramming Language.// /*Nesting of Comment */((OPTION_A))FALSE((OPTION_B))TRUE((OPTION_C))((OPTION_D))((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java is made useful for distributed system. It is possibleDue to ..........features of java((OPTION_A))Inheritance((OPTION_B))RMI((OPTION_C))API((OPTION_D))Polymorphism((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What is Literal in Java Programming?((OPTION_A))Source code representation of a fixed value((OPTION_B))special type of class((OPTION_C))special type of data type((OPTION_D))none of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))boolean result = true; Which type of literal is assigned to thevariable "result"?((OPTION_A))Boolean((OPTION_B))Char((OPTION_C))String((OPTION_D))Bool((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which type of literal is written in pair of single quote?((OPTION_A))Float((OPTION_B))boolean((OPTION_C))integer((OPTION_D))Character((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))An integer literal is of type long if and only if it has suffix - ______in Java programming.((OPTION_A))L((OPTION_B))D((OPTION_C))O((OPTION_D))F((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Single line comments starts with _____ in Java.((OPTION_A))//((OPTION_B))/* *((OPTION_C))/ *((OPTION_D))\\\\((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Following is the human readable in Java Programming Language.((OPTION_A)).class((OPTION_B)).obj((OPTION_C)).jar((OPTION_D)).java((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following converts human readable file into platformindependent code file in Java?((OPTION_A))JRE((OPTION_B))Compiler((OPTION_C))JVM((OPTION_D))Appletwatcher((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following data types comes under floating data types:1.Float 2.Int 3.Double 4.Byte 5.Long((OPTION_A))1 and 2((OPTION_B))1 and 3((OPTION_C))2 and 3((OPTION_D))4 and 5((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Character data type cannot store following value.((OPTION_A))Special character((OPTION_B))String((OPTION_C))Letter((OPTION_D))Digit((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Arrange the following statements in correct order. 1. Running the java command Statement 2. Main method of that class is executed Statement. 3. JRE is loaded along with the class you specify.((OPTION_A))Statement: 2 1 3((OPTION_B))Statement: 1 3 2((OPTION_C))Statement: 1 2 3((OPTION_D))Statement: 3 2 1((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))_______ is a compiled Java program that can be executed by the_______ command.((OPTION_A))class file & javac((OPTION_B))class file & java((OPTION_C))source file & java((OPTION_D))source file & javac((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following tool used to execute java code.((OPTION_A))Javadoc((OPTION_B))Java((OPTION_C))Rmic((OPTION_D))Javac((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))It is possible to assign a literal to a variableof a primitive type.((OPTION_A))False((OPTION_B))True((OPTION_C))((OPTION_D))((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Significant difference in Java and C++ is:((OPTION_A))Java does not allow use of pointers but C++ does((OPTION_B))Java does not support structures and unions but C++ does((OPTION_C))Java automatically deletes unused object but C++ does not((OPTION_D))All of the above((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)All differences are correct((MARKS)) (1/2/3...)1((QUESTION))Which of the following statement is correct((OPTION_A))Java is strongly typed language((OPTION_B))Java is loosely typed language((OPTION_C))Java is not a typed language at all((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)All data types are strictly defined in java. Compiler checks for type compatibility((MARKS)) (1/2/3...)1((QUESTION))Which organization’s team has created Java((OPTION_A))Microsoft((OPTION_B))Sun Microsystem((OPTION_C))Apple Inc((OPTION_D))Google((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Created by a team inside Sun Microsystem. Now acquired by Oracle. ((MARKS)) (1/2/3...)1((QUESTION))Who was leading personality among java creators((OPTION_A))James Gosling((OPTION_B))Steve Jobs((OPTION_C))Bill gates((OPTION_D))Dennis Ritchie((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)James was leading the team of Java creators in sun microsystems((MARKS)) (1/2/3...)1((QUESTION))The initial name of java was((OPTION_A))Penguin((OPTION_B))Tiger((OPTION_C))Oak((OPTION_D))Apple((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Java was initially named as Oak ((MARKS)) (1/2/3...)1((QUESTION))Which of the following statement is true about java((OPTION_A))Java is compiled language only((OPTION_B))Java is compiled and interpreted language((OPTION_C))Java is only interpreted language((OPTION_D))Java is neither compiler nor interpreted((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Java compiler generated bytecode which is then interpreted by JVM((MARKS)) (1/2/3...)1((QUESTION))Java applet is:((OPTION_A))Java compiler((OPTION_B))Java Interpreter((OPTION_C))Special small java program runs inside browser((OPTION_D))Large java programs that runs on servers((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Applets are small programs that can be run be java enabled web browsers((MARKS)) (1/2/3...)1((QUESTION))Which of the following is an early java based web browser developed by Sun Microsystems((OPTION_A))HotJava((OPTION_B))Mozilla((OPTION_C))Chromium((OPTION_D))Edge((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)HotJava browser java was written in java and developed by Sun Microsystem. It is discontinued now.((MARKS)) (1/2/3...)1((QUESTION))Java programs execution is controlled by((OPTION_A))Java Virtual Machine((OPTION_B))Java Compiler((OPTION_C))Java class library((OPTION_D))Java Servers((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)Java virtual machine executes the java programs. Compiler generated the byte code which is portable to any JVM.((MARKS)) (1/2/3...)1((QUESTION))Java compiler generated the intermediate code called:((OPTION_A))Bytecode((OPTION_B))Machine Code((OPTION_C))Applet ((OPTION_D))Servlet((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)Java complier generated bytecode which are portable can be executed by JVM.((MARKS)) (1/2/3...)1((QUESTION))main( ) method in java should be declared((OPTION_A))private((OPTION_B))public((OPTION_C))protected((OPTION_D))Default((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)main() should always be declared as public as it need to be called from outside for start of program execution.((MARKS)) (1/2/3...)1((QUESTION))main( ) method in java should be declared((OPTION_A))static((OPTION_B))not static((OPTION_C))Abstract((OPTION_D))final((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)main() should be declared as static because it need be called by Java run time system without instantiating the class.((MARKS)) (1/2/3...)1((QUESTION))Which of the flowing is a derived or non-primitive data type in java((OPTION_A))char((OPTION_B))int((OPTION_C))long((OPTION_D))array((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)arrays are derive data type in java. They are not primitive like int, float char etc.((MARKS)) (1/2/3...)1((QUESTION))Which of the following operator can be used in java to allocate memory for array((OPTION_A))malloc((OPTION_B))calloc((OPTION_C))alloc((OPTION_D))new((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)new operator can be used in java to allocate memory for array. ((MARKS)) (1/2/3...)1((QUESTION))Which of the following is a valid statement for multi-dimensional array declaration in java((OPTION_A))int tabular[][] = new int [3][];((OPTION_B))int tabular[][] = new int [][3];((OPTION_C))int tabular[][] = new int [][];((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)There is option that we can specify size for the first dimension i.e. leftmost dimension. Rest of the dimension can be allocated separately.((MARKS)) (1/2/3...)1((QUESTION)) The expression contain byte, int and literal number is promoted to((OPTION_A))byte((OPTION_B))char((OPTION_C))int((OPTION_D))long((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)The expression contain byte, int and literal is promoted to integers before any computation((MARKS)) (1/2/3...)1((QUESTION))Size of float is ................((OPTION_A))32bits((OPTION_B))16bits((OPTION_C))8bits((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Size of double is ................((OPTION_A))64bits((OPTION_B))32bits((OPTION_C))16bits((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))The smallest integer type is.... and it size is ....bits((OPTION_A))Short, 16((OPTION_B))Short, 8((OPTION_C))byte, 8((OPTION_D))byte,32((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Size of int in java is ((OPTION_A))16 bit((OPTION_B))32bit((OPTION_C))64bit((OPTION_D))8bit((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))In java byte, short and long all these are ((OPTION_A))Signed((OPTION_B))Unsigned((OPTION_C))Both of these ((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))How many primitive data types in java((OPTION_A))4((OPTION_B))7((OPTION_C))8((OPTION_D))10((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What is the range of char data type in java((OPTION_A))-128 to 127((OPTION_B))0 to 256 ((OPTION_C))0 to 65536((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following can be contain in float data type((OPTION_A))1.7e-308((OPTION_B))3.4e-038((OPTION_C))1.7e-388((OPTION_D))1.7e-068((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What is the range of byte data type in java((OPTION_A))-1024 to 1024((OPTION_B))-128 to 127((OPTION_C))-32768 to +32768((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following is not a java keyword ((OPTION_A))this((OPTION_B))public((OPTION_C))Synchronize((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Four types of integer in java((OPTION_A))bit,byte, short and long((OPTION_B))nibble,byte, short and long((OPTION_C))byte,short,int and long((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java program written to run on world wide web are called ad((OPTION_A))Websites((OPTION_B))Applets((OPTION_C))Application ((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java is designed for the distributed environment of internet because itHandles .......protocol((OPTION_A))TCP/IP((OPTION_B))UDP((OPTION_C))FTP((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java platform consists of JVM and a package of readymadeSoftware component is called...........((OPTION_A))JVMAPI((OPTION_B))API((OPTION_C))JAVA API((OPTION_D))JAPI((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Syntax of java program is based on ((OPTION_A))C((OPTION_B))Pascal((OPTION_C))Fortran((OPTION_D))C++((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java code is said to be ......so that it can be easily run on Any system((OPTION_A))Portable((OPTION_B))Simple ((OPTION_C))Discrete((OPTION_D))Complex((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Following is notable features of java((OPTION_A))Robust and secure((OPTION_B))Platform independence((OPTION_C))Useful in distributed system((OPTION_D))All of these((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Following is object oriented programming languages((OPTION_A))Java((OPTION_B))C++((OPTION_C))Python((OPTION_D))All of these((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Write once run any where at any time forever is a featuresOf...........programming((OPTION_A))C((OPTION_B))C++((OPTION_C))Java((OPTION_D))Smalltalk((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))public class While {public void loop() {int x= 0; while ( 1 ) /* Line 6 */{ System.out.print("x plus one is " + (x + 1)); /* Line 8 */ }} } Which statement is true?((OPTION_A))There is a syntax error on line 1.((OPTION_B))There are syntax errors on lines 1 and 6.((OPTION_C))There are syntax errors on lines 1, 6, and 8.((OPTION_D))There is a syntax error on line 6.((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following is TRUE?((OPTION_A))In java, an instance field declared public generates a compilationError((OPTION_B))int is the name of a class available in the package java.lang((OPTION_C))Instance variable na mes may only contain letters and digits((OPTION_D))A class has always a constructor (possibly automatically supplied bythe java compiler).((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following may be part of a class definition?((OPTION_A))instance variables((OPTION_B))instance methods((OPTION_C))Constructors((OPTION_D))all of the above((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What is byte code in the context of Java?((OPTION_A))The type of code generated by a Java compiler((OPTION_B))The type of code generated by a Java Virtual Machine((OPTION_C))It is another name for a Java source file((OPTION_D))It is the code written within the instance methods of a class((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))what is garbage collection in the context of Java?((OPTION_A))The operating system periodically deletes all of the java filesavailable on thesystem((OPTION_B))Any package imported in a program and not used is automaticallydeleted.((OPTION_C))When all references to an object are gone, the memory used by the object is automatically reclaimed((OPTION_D))The JVM checks the output of any Java program and deletesanything that doesn't make sense((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))JDK stands for((OPTION_A))Java Debugging Kit((OPTION_B))Java Developer's Kit((OPTION_C))None of these((OPTION_D))Java Decompilation Kit((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Bytecode is given as input to((OPTION_A))JRE((OPTION_B))Linker((OPTION_C))JVM((OPTION_D))Assembler((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))For converting the string to upper case .......method of string class is used((OPTION_A))toUpper()((OPTION_B))UpperCase()((OPTION_C))Upper()((OPTION_D))toUpperCase()((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Character data type cannot store following value ((OPTION_A))Special character ((OPTION_B))String((OPTION_C))Digit((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of these method of class string is used to check whether a given object start with particular string literal ((OPTION_A))startsWith()((OPTION_B))endsWiths()((OPTION_C))strats()((OPTION_D))Ends()((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))For finding the length of string ..............method is used in java((OPTION_A))len()((OPTION_B))lengthCount()((OPTION_C))length()((OPTION_D))None of these ((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))The operator can be used for concatenating two string ((OPTION_A))+((OPTION_B))->((OPTION_C))++((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))For extracting character from particular location ....method Of string class is used ((OPTION_A))Char()((OPTION_B))Charat()((OPTION_C))charIndex()((OPTION_D))charAt()((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))For checking equality of two string ......method is used in java((OPTION_A))equals((OPTION_B))Equal((OPTION_C))Isequal((OPTION_D))isEquals((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))The long can converted to without to ....without loss of information((OPTION_A))double((OPTION_B))Int float double((OPTION_C))float double((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))When double value is converted to an integer the fractional part is lost is called((OPTION_A))Truncation ((OPTION_B))Padding((OPTION_C))Loss((OPTION_D))None((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))When integer value is converted to an double the fractional part is .........((OPTION_A))Truncated((OPTION_B))Padded((OPTION_C))Conversion int to double not possible in java((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))In java array are ................((OPTION_A))Objects((OPTION_B))Primitive data types((OPTION_C))Object reference((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of these following used to allocate memory for arrayIn java((OPTION_A))malloc((OPTION_B))calloc((OPTION_C))new((OPTION_D))alloac((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What will be the output of following codeint a[]=new int[10];System.out.println(a);((OPTION_A))0((OPTION_B))0 ten times((OPTION_C))Garbage value ((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Choose the incorrect declarationint a[]=new int[10];int []a=new int[10];int a[]; a=new int[10]int a[]= int[10]new;((OPTION_A))1((OPTION_B))2((OPTION_C))3((OPTION_D))4((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What will be the result of following codeint ++i=10;System.out.prinln(++i); ((OPTION_A))100((OPTION_B))Display error ++i not enclosed in double quotes ((OPTION_C))Display error ++i not valid identifier((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Using the increment operator the value is incremented by .... ((OPTION_A))1((OPTION_B))2((OPTION_C))3((OPTION_D))4((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following can not be used as variable name in java((OPTION_A))Identifier((OPTION_B))Keyword((OPTION_C))Both a &b((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following can be the operands of arithmeticOperator ((OPTION_A))Integer((OPTION_B))Character((OPTION_C))Boolean((OPTION_D))Both a and b((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))The coding types used for data type char in java((OPTION_A))ASCII((OPTION_B))UNICODE((OPTION_C))ISO-LATIN-1((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Choose the output for following classWhileEmpty {public static void main(String args[]){char first = 'A';char last = 'Z';while (++first < --last);// While iteration ends, marked by semi colonSystem.out.println("Somewhere in middle is "+first);}}((OPTION_A))Somewhere in middle is 13((OPTION_B))Somewhere in middle is Z((OPTION_C))Somewhere in middle is 10((OPTION_D))Somewhere in middle is N((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)while statement is incrementing the first and decrementing the last character using its integer value and when it is equal somewhere in middle then prints N.((MARKS)) (1/2/3...)2((QUESTION))Choose the correct output:classStringEqDemo {public static void main(String args[]){int length;boolean result1;boolean result2;String str = new String ("Java is Good");String str2 = "Java is Good";String str3 = "java is good";result1= str.equalsIgnoreCase(str2);result2= str.equalsIgnoreCase(str3);System.out.println("Is str equals str2: "+result1);System.out.println("Is str equals str3: "+result2);}}((OPTION_A))Is str equals str2: trueIs str equals str3: false((OPTION_B))Is str equals str2: falseIs str equals str3: false((OPTION_C))Is str equals str2: trueIs str equals str3: true((OPTION_D))Is str equals str2: falseIs str equals str3: true((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)The case insensitive version is equalsIgnoreCase() . It does not consider the case of letters while matching((MARKS)) (1/2/3...)1((QUESTION))System.out.println(). What is System in the statement((OPTION_A))Method((OPTION_B))Class((OPTION_C))Variable((OPTION_D))Package((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)System is an inbuilt class available in java.lang package((MARKS)) (1/2/3...)1((QUESTION))System.out.println(). What is out in the statement((OPTION_A))Method((OPTION_B))Class((OPTION_C))Variable((OPTION_D))Package((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)outis a reference variable in System class containing the reference of standard output stream object.((MARKS)) (1/2/3...)1((QUESTION))System.out.println(). What is printlnin the statement((OPTION_A))Method((OPTION_B))Class((OPTION_C))Variable((OPTION_D))Package((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)println is a method available in output stream object. ((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println(16/5); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)operands are evaluated and result printed as integers((MARKS)) (1/2/3...)2((QUESTION))What will the output of following java statement: System.out.println(16.0/5); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)operands are evaluated and result printed as double((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println(16/5.0); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)operands are evaluated and result printed as double((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println(16.0/5.0); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)Bothoperands are treated as double and result result evaluated as double((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println(16.0/(int)5.0); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)denominator is initially casted into int but later used as double evaluation since the numerator is implicitly double((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println(16/(int)5.0); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)denominator is initially casted into int and remains int for the operation as numerator is implicitly int.((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println((double)16/(int)5.0); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)denominator is initially casted into int and numerator is casted into double. The entire statement is evaluated and printed as double((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println((double)16/5); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)Numerator is evaluated as double and hence operation is double((MARKS)) (1/2/3...)1((QUESTION))What will the output of following java statement: System.out.println((double)(16/5)); ((OPTION_A))3.2((OPTION_B))3((OPTION_C))3.0((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Parenthesis enclosing the operand force first the natural int operation resulting in 3 and the result is evaluated and printed as double that is 3.0.((MARKS)) (1/2/3...)1((QUESTION))void declaration in a method means((OPTION_A))method can return anything((OPTION_B))method does not return anything((OPTION_C))method returns int or float only((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B ((EXPLANATION)) (OPTIONAL)As in c++ and c, java also supports void, which means method returns nothing((MARKS)) (1/2/3...)1((QUESTION))Which of the option is true about the following statementStudent s1 ;((OPTION_A))s1 is a reference variable of type Student((OPTION_B))s1 is class((OPTION_C))s1 is an object((OPTION_D))None((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)The statement only declares s1 a reference variable of type Student. Does not create any object((MARKS)) (1/2/3...)1((QUESTION))Which of the option is true about the following statementStudent s1 = new Stundet( );((OPTION_A))s1 is a reference variable containing reference of newly created object((OPTION_B))s1 is just a reference variable containing null((OPTION_C))The above statement does not create any object((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)The statement declares s1 a reference variable of type Student and creates object referred by s1((MARKS)) (1/2/3...)1((QUESTION))Which of the option is true about the following statementStudent s1 = new Stundet( );((OPTION_A))Student( ) is method call.((OPTION_B))Student( ) is destructor call((OPTION_C))Student( ) is a constructor call((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Student ( ) is a no argument constructor call.((MARKS)) (1/2/3...)1((QUESTION))Which of the option is true about the following statementStudent s1 = new Stundet( );((OPTION_A))new creates the object at runtime((OPTION_B))new created the object at compile time((OPTION_C))new is used to destroy the object((OPTION_D))None((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)new operator is used for dynamic memory allocation in heap space in java.((MARKS)) (1/2/3...)1((QUESTION))Choose the most appropriate statement for java to be a secure language((OPTION_A))Java is compiled and interpreted((OPTION_B))Bytecode is not easily readable((OPTION_C))Java programs runs inside JVM((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Java byte code runs inside JVM that restricts program to directly interact with Systems resources and hence makes java secure.((MARKS)) (1/2/3...)2((QUESTION))Consider the following statement and choose the optionint [] intArr = {2,4,6,8,10};What value is stored in intArr[1] ? ((OPTION_A))0((OPTION_B))2((OPTION_C))4((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)Array index in java like in C and C++ starts from 0.((MARKS)) (1/2/3...)2((QUESTION))Consider the following statement and choose the optionint [] intArr = {10,15,12,13,11};What value is stored in intArr[3] ? ((OPTION_A))10((OPTION_B))13((OPTION_C))12((OPTION_D))11((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Array index in java like in C and C++ starts from 0.((MARKS)) (1/2/3...)2((QUESTION))Consider the following statement and choose the optionint [] intArr = {10,15,12,13,11,99};What value is stored in intArr[5] ? ((OPTION_A))10((OPTION_B))13((OPTION_C))12((OPTION_D))99((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)Array index in java like in C and C++ starts from 0.((MARKS)) (1/2/3...)2((QUESTION))Consider the following statement and choose the optionint [] intArr = {2,4,6,8,10};intArr in above statement is ? ((OPTION_A))Reference varibale((OPTION_B))Class((OPTION_C))Method((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)intArr is a reference variable containing the reference of an array object((MARKS)) (1/2/3...)2((QUESTION))Which if the option is true about following statementint [] intArr = {2,4,6,8,10};((OPTION_A))intArr is a primitive array in java((OPTION_B))intArr is a reference variable holding the reference of an array object((OPTION_C))intArr is a method in java((OPTION_D))None((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)intArr is a reference variable containing the reference of an array object((MARKS)) (1/2/3...)2((QUESTION))What will be the output of following code segmentint sum = 0;int count = 1;while (count < 5) { sum = sum + count;count = count + 2; }System.out.println(sum);((OPTION_A))3((OPTION_B))6((OPTION_C))4((OPTION_D))15((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)The simple while loop that stores the final result 4 in sum varibale((MARKS)) (1/2/3...)2((QUESTION))What will be the output of following code segmentfor (int row = 1; row <= 3; row ++){ for (int count=1;count<=(4–row); count++) { System.out.print(“*”); }System.out.println();}((OPTION_A))******((OPTION_B))********((OPTION_C))******((OPTION_D))***((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)The first for loop keep tracks of row counts and second keep tracks of character count.((MARKS)) (1/2/3...)1((QUESTION))String in Java is ((OPTION_A))array of primitive characters((OPTION_B))Class((OPTION_C))Method((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)String is a class in java((MARKS)) (1/2/3...)1((QUESTION))equal( ) method is available in built in class((OPTION_A))String((OPTION_B))Exception((OPTION_C))Object((OPTION_D))Student((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)String class has a built in method for string comparison called equal( )((MARKS)) (1/2/3...)1((QUESTION))Which of the following is example of selection statement in java((OPTION_A))For((OPTION_B))While((OPTION_C))do-while((OPTION_D))switch((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)Switch is selection statement and others are iteration statements((MARKS)) (1/2/3...)1((QUESTION))Which of the following is example of iteration statement in java((OPTION_A))For((OPTION_B))if-else((OPTION_C))goto((OPTION_D))switch((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)for is a iteration statement as in C and C++((MARKS)) (1/2/3...)1((QUESTION))Which of the following is example of jump statement in java((OPTION_A))for((OPTION_B))break((OPTION_C))goto((OPTION_D))Switch((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)break causes the control jump out of the current block.((MARKS)) (1/2/3...)1((QUESTION))Class is an example of ((OPTION_A))Primitive data type((OPTION_B))Derived or User defined types((OPTION_C))Complicated data types((OPTION_D))All of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)Primitive types are int,char float etc. Class is derived type((MARKS)) (1/2/3...)1((QUESTION))char is an example of((OPTION_A))Primitive data type((OPTION_B))Derived or User defined types((OPTION_C))Complicated data types((OPTION_D))All of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)Primitive types are int, char, float etc. Class is derived type.((MARKS)) (1/2/3...)1((QUESTION))JAVA is case sensitive language((OPTION_A))True((OPTION_B))False((OPTION_C))Unpredictable((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))In JAVA language main function is used ____ the class((OPTION_A))Outside((OPTION_B))Inside((OPTION_C))Both A&B((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))JAVA is designed by((OPTION_A))Dennis Ritchie((OPTION_B))James Gosling((OPTION_C))Both A & B((OPTION_D))Bjarne Stroustrup((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Scanner is a class defined in which package((OPTION_A))java.util((OPTION_B))java.Io((OPTION_C))java.lang((OPTION_D))None of this((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Previously java was known as((OPTION_A))java only((OPTION_B))Jdk((OPTION_C))Apple((OPTION_D))Oak((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))JAVA is developed by((OPTION_A))Microsoft((OPTION_B))Sun((OPTION_C))Oracle((OPTION_D))Google((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Exception class avialable in((OPTION_A))java.util((OPTION_B))java.io((OPTION_C))java.lang((OPTION_D))java.awt((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))In JAVA language new operator is used to allocate the memory to((OPTION_A))Class((OPTION_B))Object((OPTION_C))Function ((OPTION_D))None of this((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))The Java Program is enclosed in a class definition((OPTION_A))TRUE((OPTION_B))False((OPTION_C))Unpredictable((OPTION_D))None of this((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What is object in Java((OPTION_A))An entity representing some characteristics and behavior((OPTION_B))It is an variable((OPTION_C))It is an Class((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following features are common to both Java & C++?((OPTION_A))The class declaration((OPTION_B))The access specifiers((OPTION_C))The object creation((OPTION_D))Both A & B((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))For compiling a java program following command is used((OPTION_A))Java((OPTION_B))Javac((OPTION_C))Javad((OPTION_D))Javadoc((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java compiled programs hava which extension((OPTION_A)).java((OPTION_B)).exe((OPTION_C)).obj((OPTION_D)).doc((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))JVM stands for((OPTION_A))Java Variable Machine((OPTION_B))Java virtual machine((OPTION_C))Java Volatile Machine((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))In order to run Java program ,we need to install which application((OPTION_A))Jdk((OPTION_B))Dbk((OPTION_C))Sdk((OPTION_D))All of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What is jdk((OPTION_A))java development kit((OPTION_B))java deployment kit((OPTION_C))java demo kit((OPTION_D))java distributed kit((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java intermediate code is known as((OPTION_A))Byte code((OPTION_B))Javacode((OPTION_C))reference code((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What do you mean by JRE((OPTION_A))java runtime environment((OPTION_B))java runtime execution((OPTION_C))java runtime exception((OPTION_D))none of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))When object is created following is executed((OPTION_A))Class((OPTION_B))Destructor((OPTION_C))Constructor((OPTION_D))member function((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Following is a program that can be executed on IDE((OPTION_A))C((OPTION_B))C++((OPTION_C))JAVA((OPTION_D))all of the above((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Array passed as an argument to a function is interpreted as((OPTION_A))Address of the array((OPTION_B))Values of the first elements of the array((OPTION_C))Address of the first element of the array((OPTION_D))Number of element of the array((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Eclipse cannot run JAVA program if JDK is not installed in it .((OPTION_A))True ((OPTION_B))False((OPTION_C))Without jdk run the program((OPTION_D))No need of jdk in eclipse((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Eclipse is free open-source Integrated development environment.((OPTION_A))True((OPTION_B))False((OPTION_C))Eclipse is not an IDE((OPTION_D))None of the above((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))J2SE stands for((OPTION_A))JAVA 2 PLATFORM STANDARD edition ((OPTION_B))JAVA 2 PLATFORM STANDARD EDITOR((OPTION_C))JAVA 2 STANDARD EDITION((OPTION_D))JAVA 2 STANDARD EDITOR((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))J2EE stands for((OPTION_A))JAVA 2 ECONOMIC EDITION((OPTION_B))JAVA 2 ENTERPRISE EDITION((OPTION_C))JAVA 2 E-PLATFORM EDITION((OPTION_D))JAVA 2 EASY EDITION((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))JSME((OPTION_A))JAVA 2 MICRO EDITION((OPTION_B))JAVA 2 MOBILITY EDITION((OPTION_C))JAVA 2 MOBILE EDITION((OPTION_D))JAVA 2 M-Enterprise EDITION((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following is smallest integer data type?((OPTION_A))Bytecode((OPTION_B))Int ((OPTION_C))Short((OPTION_D))Long((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))JVM converts((OPTION_A)).class file to .java file((OPTION_B)).object file to .java file((OPTION_C)).java file to .object file((OPTION_D)).java file to .class file((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))java util is a((OPTION_A))Class((OPTION_B))Subclass((OPTION_C))Method ((OPTION_D))Package((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))java Date package support((OPTION_A))current date only((OPTION_B))current date and time((OPTION_C))current time only((OPTION_D))Time management ((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))bytecode provide((OPTION_A))security and portability((OPTION_B))security only((OPTION_C))portablity only((OPTION_D))none of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))getc() is((OPTION_A))Reads a character from a file((OPTION_B))write a character from a file((OPTION_C))Both A & B((OPTION_D))None of this((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))putc()is((OPTION_A))Reads a character from a file((OPTION_B))write a character from a file((OPTION_C))Both A & B((OPTION_D))None of this((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION)).____ the first web browser developed in Java?((OPTION_A))Internet Explorer((OPTION_B))Netscape Navigator((OPTION_C))Opera((OPTION_D))HOT Java((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))_____ is the ability of an Java application to perform multiple tasks at the same time?((OPTION_A))Multiprogramming((OPTION_B))Multithreading((OPTION_C))Multiprocessing((OPTION_D))Multitasking((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following also known as an instance of a class?((OPTION_A))Friend Functions((OPTION_B))Object((OPTION_C))Member Functions((OPTION_D))Member Variables((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))What is the size of integer in Java Programming.((OPTION_A))2 Bytes((OPTION_B))8 Bytes((OPTION_C))3 Bytes((OPTION_D))4 Bytes((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following is smallest integer data type?((OPTION_A))Bytecode((OPTION_B))Int((OPTION_C))Short((OPTION_D))Long((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))boolean result = true; Which type of literal is assigned to the variable "result"?((OPTION_A))Boolean((OPTION_B))Char((OPTION_C))String((OPTION_D))Double((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Java source code is compiled into _______.((OPTION_A))Bytecode((OPTION_B)).exe((OPTION_C))Source code((OPTION_D)).obj((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Public class Test{Public static void main(String []args){for(inti=0;i<4;i++){Switch(i){case 0:break;case 1:System.out.println(“1case 2:System.out.println(“2case 3:System.out.println(“3case 4:System.out.println(“4}}System.out.println(“Bye”);}}((OPTION_A))1 2 3 4 Bye((OPTION_B))Bye((OPTION_C))1 2 3 4 2 3 4 3 4 Bye((OPTION_D))1 2 3 4 1 2 3 4 1 2 3 4 Bye((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))The statement that tests to see if sum is equal to 10 and total is less than20, and if so, prints the text string "incorrect.",is((OPTION_A))if( (sum = 10 && total < 20)printf( “incorrect”);((OPTION_B))if( (sum == 10 &&total < 20)printf( “incorrect”);((OPTION_C))if( (sum == 10)??(total < 20)printf( “incorrect”);((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))public void foo( boolean a, boolean b){if( a ){System.out.println("A");}else if(a && b) {System.out.println( "A && B");}else{if ( !b ){System.out.println( "notB") ;}else{System.out.println( "ELSE" ) ;}}}Choose the correct output?((OPTION_A))If a is true and b is true then the output is "A && B”((OPTION_B))If a is true and b is false then the output is "notB"((OPTION_C))If a is false and b is false then the output is "ELSE"((OPTION_D))If a is false and b is true then the output is "ELSE"((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?Consider,for(i=1,j=1;i<5;i++)j+=i;System.out.println(“i=” +i);((OPTION_A))4((OPTION_B))5((OPTION_C))6((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class Test{public static void main(String [] args){int a=10,b=20;int sum=a+++--b;System.out.println(“sum” +sum);}}((OPTION_A))31((OPTION_B))32((OPTION_C))30 ((OPTION_D))29((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which of the following also known as an instance of a class?((OPTION_A))Friend Functions((OPTION_B))Object((OPTION_C))Member Functions((OPTION_D))Member Variables((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which is valid declaration of a float?((OPTION_A))float f = 1F;((OPTION_B))float f = 1.0;((OPTION_C))float f = 1.0d;((OPTION_D))float f = "1";((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class Test{public static void main(String [] args){Test p = new Test();p.start();}void start(){boolean b1 = false;boolean b2 = fix(b1);System.out.println(b1 + " " + b2);}boolean fix(boolean b1){b1 = true;return b1;}}((OPTION_A))true true((OPTION_B))false true((OPTION_C))true false((OPTION_D))false false((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class Test{public static void main(String[] args){for(int i = 0; 1; i++){System.out.println("Hello");break;}}}((OPTION_A))Compilation error((OPTION_B))Hello((OPTION_C))Hello Hello((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))System.out.println(“Hellow”);Here Out is ____((OPTION_A))Class((OPTION_B))Object ((OPTION_C))Function((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))System.out.println(“Hellow”);Here println is ____((OPTION_A))Class((OPTION_B))Object ((OPTION_C))Method((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))JAVA was invented by……………. in year……………………((OPTION_A))Dennis Ritchie in 1971((OPTION_B))Ken Thomas 1983((OPTION_C))James Gosling 1991((OPTION_D))Job Steve 1994((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Which three are valid declarations of a char?1. char c1 = 064770;2. char c2 = 'face';3. char c3 = 0xbeef;4. char c4 = \u0022;5. char c5 = '\iface';6. char c6 = '\uface';((OPTION_A))1, 2 and 4((OPTION_B))1, 3 and 6((OPTION_C))3,5, and 2((OPTION_D))4,5 and 6((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Which three are valid declarations of a float?1. float f1 = -343;2. float f2 = 3.14;3. float f3 = 0x12345;4. float f4 = 42e7;5. float f5 = 2001.0D;6. float f6 = 2.81F;((OPTION_A))1,2,4((OPTION_B))2,3,5((OPTION_C))1,3,6((OPTION_D))2,4,6((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))Which is a valid declarations of a String?((OPTION_A))String s1 = null;((OPTION_B))String s2 = 'null';((OPTION_C))String s3 = (String) 'abc';((OPTION_D))String s4 = (String) '\ufeed';((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))The JAVA language was initially called((OPTION_A))JDK 1.0((OPTION_B))Oak((OPTION_C))JVM((OPTION_D))Palm((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))The statement that tests to see if sum is equal to 10 and total isless than 20, and if so, prints the text string "incorrect.",is((OPTION_A))if( (sum = 10 && total < 20) printf( “incorrect”);((OPTION_B))if( (sum == 10 &&total < 20) printf( “incorrect”);((OPTION_C))if( (sum == 10)??(total < 20) printf( “incorrect”);((OPTION_D))None of these.((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Consider the following code snippetString river = new String(“Columbia”);System.out.println(river.length());What is printed?((OPTION_A))6((OPTION_B))7((OPTION_C))8((OPTION_D))Columbia((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)1((QUESTION))You read the following statement in a Java program that compilesand executes.submarine.dive(depth);What can you say for sure?((OPTION_A))depth must be an int((OPTION_B))dive must be a method.((OPTION_C))dive must be the name of an instance field.((OPTION_D))submarine must be the name of a class((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Guess the output of the following program.public class NumberSystem{public static void main(String[]args) {int hexVal = 0x1a;System.out.println(“Value:”);}}((OPTION_A))25((OPTION_B))32((OPTION_C))26((OPTION_D))24((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Consider the following code snippet. What will be assigned to thevariable fourthChar, if the code is executed?String str = new String(“Java”char fourthChar = str.charAt(4);((OPTION_A))‘a’((OPTION_B))‘v’((OPTION_C))throws StringIndexOutofBoundsException((OPTION_D))null character((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?public class test {static boolean fun(char ch){System.out.println(ch);return true;}public static void main(String[] args) {int i=0;for(fun('P');fun('Q')&&(i<3);fun('R')){i++;fun('S');}}}((OPTION_A))PQRSPQRSPQRS((OPTION_B))PQSRQSRQSRQ((OPTION_C))Compilation Error((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?Consider,for(i=1,j=1;i<5;i++)j+=i;System.out.println(i);((OPTION_A))4((OPTION_B))5((OPTION_C))6((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What will be the output of this code?class Test {protected int x, y;}class Main {public static void main(String args[]) {Test t = new Test();System.out.println(t.x + " " + t.y);}}((OPTION_A))0 0((OPTION_B))Compilation error((OPTION_C))Run time error((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class Main {public static void main(String args[]) {System.out.println(fun());}int fun() {return 20;}}((OPTION_A))20((OPTION_B))Compilation error((OPTION_C))None of these((OPTION_D))Infinite loop((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class Main {public static void main(String args[]) {System.out.println(fun());}static int fun() {return 20;}}((OPTION_A))20((OPTION_B))Compilation error((OPTION_C))None of these((OPTION_D))Infinite loop((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class Test {public static void main(String args[]) {System.out.println(fun());}static int fun() {static int x= 0;return ++x;}}((OPTION_A))0((OPTION_B))1((OPTION_C))2((OPTION_D))Compilation error((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class demo{int a=4;public void show(){System.out.println(a);}public static void main(String args[]){a++;show();}}((OPTION_A))4((OPTION_B))5((OPTION_C))6((OPTION_D))Compilation error((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class Foo {public int a=3;public void addFive() {a+=5;System.out.print("f ");}public static void main(String[]args) {Foo f = new Foo();f.addFive();System.out.println(f.a);}}((OPTION_A))F((OPTION_B))8((OPTION_C)) f8((OPTION_D))None of these ((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class app{public static void main(String[] args){char char1;char1 = 65;System.out.println("char1 + 1 = "+ char1 +1);}}((OPTION_A))char1 + 1 = a((OPTION_B))char1 + 1 = A((OPTION_C))char1 + 1 = A1((OPTION_D))char1 + 1 = a1((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Consider the following code snippet.if (aNumber >= 0)if (aNumber == 0)System.out.println("first string");elseSystem.out.println("second string");System.out.println("third string");What output do you think the code will produce if aNumber is 3?((OPTION_A))first string((OPTION_B))second stringthird string((OPTION_C))third string((OPTION_D))first stringthird string((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))import java.util.*;class Pattern {public static void main(String[] args) {Scanner input=new Scanner(System.in);System.out.print("Enter N: ");int N=input.nextInt();for(int i=1;i<=N;i++) {for(int j=0;j<N-i;j++)System.out.print(" ");for(int j=0;j<(2*i-1);j++)System.out.print("*");System.out.println();}}} What will be the output if N=3?((OPTION_A)) *********((OPTION_B))******((OPTION_C))*****((OPTION_D))Compilation error.((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Consider the code:String x = new String("xyz");String y = "abc";x = x + y;How many String objects have been created?((OPTION_A))2((OPTION_B))3((OPTION_C))4((OPTION_D))5((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Consider the code:String x = new String("xyz");String y = "abc";x = x + y;What will be the output of the program?((OPTION_A))Xyzabc((OPTION_B))xyz((OPTION_C))abc((OPTION_D))xyz abc((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))class BoolTest{public static void main(String [] args){int result = 0;Boolean b1 = new Boolean("TRUE");Boolean b2 = new Boolean("ture");if (b1.equals(b2) )result = result + 1000;System.out.println("result = " + result);}}What will be the output of this code?((OPTION_A))result = 0((OPTION_B))result = 1000((OPTION_C))result = 2000((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))class BoolTest{public static void main(String [] args){int result = 0;Boolean b1 = new Boolean("TRUE");Boolean b2 = new Boolean("true");if (b1.equals(b2) )result = result + 1000;System.out.println("result = " +result);}}What will be the output of this code?((OPTION_A))result = 0((OPTION_B))result = 1000((OPTION_C))result = 2000((OPTION_D))None of these((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))What is the output of following code segment?class BoolTest {public static void main(String [] args) {int result = 0;Boolean b1 = new Boolean("TRUE");Boolean b2 = new Boolean("true");Boolean b3 = new Boolean("tRuE");Boolean b4 = new Boolean("false");if (b1 == b2) /* Line 10 */result = 1;if (b1.equals(b2) ) /* Line 12 */result = result + 10;if (b2 == b4) /* Line 14 */result = result + 100;if (b2.equals(b4) ) /* Line 16 */result = result + 1000;if (b2.equals(b3) ) /* Line 18 */result = result + 10000;System.out.println("result = " + result);} }((OPTION_A))result = 0((OPTION_B))result = 1((OPTION_C))result = 10((OPTION_D))result = 10010((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))String x = "xyz";x.toUpperCase(); /* Line 2 */String y = x.replace('Y', 'y');y = y + "abc";/* Line 4 */System.out.println(y);What will be the output of the program?((OPTION_A))bcXyZ((OPTION_B))Abcxyz((OPTION_C))Xyzabc((OPTION_D))XyZabc((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))int i = 1, j = 10;do{if(i++ > --j) /* Line 4 */{ continue; }} while (i < 5);System.out.println("i = " + i + "and j = " + j); /* Line 9 */What will be the output of the program?((OPTION_A))i = 6 and j = 5((OPTION_B))i = 5 and j = 5((OPTION_C))i = 6 and j = 6((OPTION_D))i = 5 and j = 6((CORRECT_CHOICE)) (A/B/C/D)D((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))class Q207 {public static void main(String[] args) {int i1 = 5;int i2 = 6;String s1 = "7";System.out.println(i1 + i2 + s1); /* Line 8 */} } What will be the output of the program?((OPTION_A))18((OPTION_B))117((OPTION_C))567((OPTION_D))Compiler error((CORRECT_CHOICE)) (A/B/C/D)B((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))switch(x){default:System.out.println("Hello");}Which two are acceptable types for x?((OPTION_A))byte and char((OPTION_B))long and float((OPTION_C))char and short((OPTION_D))float and long((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))public void test(int x){ int odd = 1;if(odd) /* Line 4 */{ System.out.println("odd"); }else{ System.out.println("even");} } Which statement is true?((OPTION_A))Compilation fails.((OPTION_B))"odd" will always be output.((OPTION_C))"even" will always be output.((OPTION_D))"odd" will be output for odd values of x, and "even" for even values.((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)((MARKS)) (1/2/3...)2((QUESTION))Choose the correct output:classStringEqDemo {public static void main(String args[]){int length;boolean result1;boolean result2;String str = new String ("Java is Good");String str2 = "Java is Good";String str3 = "java is good";result1= str.equals(str2);result2= str.equals(str3);System.out.println("Is str equals str2: "+result1);System.out.println("Is str equals str3: "+result2);}}((OPTION_A)) Is str equals str2: trueIs str equals str3: false((OPTION_B))Is str equals str2: falseIs str equals str3: false((OPTION_C)) Is str equals str2: trueIs str equals str3: true((OPTION_D)) Is str equals str2: false Is str equals str3: true((CORRECT_CHOICE)) (A/B/C/D)A((EXPLANATION)) (OPTIONAL)equals() method considers the case of string while matching. The case insensitive version is equalsIgnoreCase()((MARKS)) (1/2/3...)2((QUESTION))Choose the correct output:classContinueDemo {publicstaticvoid main(String args[]){intx=10;for (inti=1; i<=10 ; i++){if (i%2 == 0)continue;System.out.println("Numnber is "+ i);}}((OPTION_A))Number is 1Number is 2Number is 5Number is 8Number is 9((OPTION_B))Number is 1Number is 3Number is 5Number is 7Number is 9Number is 11((OPTION_C)) Number is 1Number is 3Number is 5Number is 7Number is 9((OPTION_D))Number is 3Number is 5Number is 7 Number is 9((CORRECT_CHOICE)) (A/B/C/D)C((EXPLANATION)) (OPTIONAL) ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download