java 2017 8 May,2021 boomtecho2@gmail.comLeave a comment 1. Java is : Compiled language Interpreted language Neither A nor B are true Both A and B are true 2. This is not a primitive data type in java : Double String Float Boolean 3. Java Does not have this : Objects Classes Event Driven Capability None of the above 4. Java virtual Machine is basically a : language Compiler Interpreter Assembler 5. Applets are created to run primarily on : Servers Personal Computer Mobile Phones Clients 6. A Break Statement can not be used inside a : For Switch Both A and B are True Neither A nor B are true 7. This Statement does nothing : ; null ; 7=7; 10; 8. What will be output of this code ? String a []; b=new String[4]; System.out.println(a[2]); Null Garbage 0 Empty String 9. What is output of this code ? double x=100/17; System.out.println(x); 5.8 5.9 5.0 5 10. In Java, all types are always passed by : value Reference Both A and B Are correct Both A and B Are Incorrect 11. Insted of ‘goto’ of C++ java providers: Labels with Loops Labels with Statement Blocks Both A and B Are correct Both A and B Are Incorrect 12. Method used to obtain information about an object are known as : Friend Methods Accessor methods Precursor methods Class Methods 13. Concat method can be used to concatenate : String methods String classes String Objects All of the Above 14. This kind of java operators have minimum precedence with respect to all operators : Assignment Relational Additive Equality 15. What is the value of ‘a’ after execution of this code ? int a=23, b=34; a=((a<b)?(b+a):(b-a)); 11 23 57 34 16. import java.io.*; Here import statement is asking java compiler to include all public classes from package : java.servlet java.lang java.applet java.io 17. Which operations can be performed on string objects ? + += Both A and B are Correct Both A and B are Incorrect 18. Minimum number of statements in aĀ block can be : No minimum limit 0 1 Statements are not in block blocks are in statement 19. Which code makes ‘a’ equal to 8? Ā intĀ a =32; a=a>>2; 2.Ā int a =33; a=a>>2; 3.Ā int a =35; a=a>>2; 4. int a=16; a=a>>1; 1 1 and 2 1,2 and 3 1,2,3 and 4 20. this is not related to web technology : XML HTML HTTP None of these 21. This is not Active X Scripting language : JScript XML SQL VB Script 22. The Program ProvidingĀ an Active X document can be a : Internet router DLL Server HTML All of these 23. I StorageĀ is used for providing SQL Hypertext Internet Storage ActiveX Documents 24. Hypertext is composed of : Plaintext Only Coloured Image Only Black and white video Only Video 25. In ASP request form reads data sent from : GET POST Both A and B are correct Both A and B are Incorrect 26. The Primary Java Compiler inĀ JDK is : JIT JVM javaC jdkC 27. The Number Of bytes needed to store a number of type ‘double ‘ is : 2 4 8 JVM dependent 28. This/these Operator/Operators does not/don’t always evaluate all its/their operands : || ?: && All of these 29. LetĀ A beĀ a class Let B be a subclass of A Let x be a B object The condition x instance of A : Evaluate True Evaluate False REsults in Compilation error Result in an Exception 30. What is the output of this program ? int m=1 for (;m<20;m++) System.out.println(m+=1+m); 21220 212182 2642 none of these 31. If we use ‘ ‘ as a character constant ,it will be : Correct Incorrect Both A and B are correct Both A and B are Incorrect 32. This statement will give Compilation error : System.out.println(“Java”); system.out.println(java”); System.out.println(“java”); System.out.println(“JAVA”); 33. Program which execute applet is know as : Virtual Machine Java virtual machine Applet engine None of the above 34. We use Array as a parameter of main method because : It can store multiple values It can hold multiple pointer It can store other methods None of above 35. This method executes only once : start () method stop () method destroy () method init () method 36. x=x+1 is equivalent to : ++x x++ x=x-1 none of above 37. Super is the predefined : keyword method both A and B are correct both A and B are incorrect 38. Java Intermediate code is called : mid code bit code Intermediate code Byte code 39. This is predefined package : util package io package Lang package All of these 40. Java Interpretation is done using : javac javap java javaC 41. Which statement result in compilation error ? int a =(short)7.5; short a=(int)7.5; byte a=(int)7.5; 1 2 3 none of these 42. Which is not a java modifier? Friendly Private public transient 43. Consider this code : if(a>b) System.out.println(“a”); else System.out.println(“b”); System.out.println(“c”); When will ‘c’ get printed ? a>b a a==b All of the above are true 44. This is invalid declaration of aĀ local variable : long a b c final int array static int xyz All of the above 45. What is the output of this statement ? System.out.println(“Hello”+4+9); Uncertain Hello 49 Hello 13 Hello +4 +9 46. How can we print ‘x’ with this code ? if (a>b) if(b>c) if(a<=c) System.out.println(“x”); else System.out.println(“y”); a>b and a b a>b and b<=c It can not be printed 47. This operator is used to concatenate two or more string objects : += + & || 48. This method of string class is used to obtain length of string object : get(0 sizeof() length() length of () 49. This Data type value is returned by equals () method of String class : int boolean char string 50. Which statement is invalid String a = “xyz”; String b= new String(“rst”); String c = new String (); None of the above 51. This is not a java keyword : int Int interface final 52. a.x(z); In the above statement , this is true : ‘a’ is a method ‘a’ is a class ‘x’ is a method ‘a’ is an object 53. The Output of this program is : public class guru { public static void main(String []args) { int i=18; { intĀ i=15; System.out.println(“i”); }}} Compilation Error Runtime Error Print 18 Print 15 54. What is the output of this program ? public class c{ public int d(int m){ System.out.println(m+m); return m; } public static void main(String []args) { System.out.print(d(7)); } } Compilation Error Runtime Error print 147 print 14 55. While Loop Controlled By : Entry Condition Exit Condition Both A and B are True Both A and B are False 56. In Java , Nesting of if -else statement is : Not permitted Sometimes not permitted Always permitted Not Permitted beyond first level 57. this knid of Loop can never get into infinite iteration time : for while do- while None of the above 58. Instead of Multiple inheritance ,java provide : Multilevel inheritance Interfaces Classes Hierarchical Inheritance 59. Java Object are created by : class Method new final 60. What is wrong in this program ? public class A { Public static void main(String []args) { boolean []b=new boolean[10]; system.out.print(b.length()); } } system.out.print(b.length()); boolean []b=new boolean[10]; public class A Nothing is wrong 61. What is wrong in this program ? public class x{ public static void main(string []args){ String s = “abcde”; System.out.print (s.length()); }} String s =”abcde”; System.out.print(s.length()); public static void main( string []args) none of the above 62. What is the output of the following program ? public class cale{ public static void main(String []args) { int a=45,b=10,c=2; System.out.println(a/b/c); } } 2.5 2 9 2.25 63. The super class of panel class is : Window Container Applet Frame 64. The Container with title bar And menu bar is : Frame Panel Window Window panel 65. This is not a part of GUI : CheckBox Button Text None Of the above 66. This is the way to declared a Button Class in AWT : public class Button extends component implements accessible public class Button extends accessible implements component public class component extends Button implements accessible public class component extends accessible implements Button 67. AWT panel can not have this /these : Text Button Both A and B are Incorrect Both A and B are correct 68. ASP interpreter reads and executes all script code between : >% and %< <% and %> >% and >% <% and <% 69. HTTP is this kind of protocol: transport protocol Application Protocol Routing Protocol None of the above 70. With Active X Support , Active X Scripting Language /languages is/are : Perl VB Script Python All of the above 71. The application/applications using ActiveX controls is /are : Mozilla FireFox Internet Explorer Google Chrome All of the above 72. Microsoft Excel Sheet can be edited within a power using : Active Messaging ActiveX Streaming Active X Documents All of the Above 73. This is false : Active X Control can not be supported by java Active X is a Microsoft Technology ActiveX is used on UNIX also Active X is used on Macintosh 74. Total Bytes property of ASP request does this : Returns total number of bytes sent by client Returns total number of bytes received by client Returns total number of bytes sent by server Returns total number of bytes received by server 75. URL stands for : Unique reference table uniform reference lable uniform resource locator unique resource locator 76. This is environment variable contains a list of directories where java looks for classes reference in a program: PATHVAR CLASSVAR CLASSPATH SEARCHPATH 77. Null is an Object : This statement is correct This Statement is incorrect This statement is ambiguous None Of the Above 78. Which is not correct : int []var={10,15,20}; int var[]={10,15,20}; int [3]var=new int[]{10,15,20}; int []var=new int[]{10,15,20}; 79. Garbage Collector helps us for : Valid references Invalid references recursion Iteration 80. the Result of -17%-3 is : +2 -2 0 5.66 81. This is incorrect statement: Java does not support operator overloading java does not support global variable java does not use header files none of the above 82. What is the output of this program ? public class C { public static int computer(int a, int b) { if(b==0) return a ; return computer(b,a%b); } public static void main(String []args){ System.out.print(c.computer(77,252));}} 7 77 2 1 83. What is the output of this code ? double a =0.0/0.0; system.out.println(a); Compilation error Garbage value Prints infinite none of the above 84. How Many times will while loop in this code run? public class c{ public static void main(String []args) { char ch=’a’; while(ch++ <=’z’) System.out.print(–ch); }} one time two time three time infinite time 85. Which Operators associate from right to left ? = ++ (pre-incremnet) Both A and B are Correct Both A and B are Incorrect 86. To give a label to a loop , the label is placed at: Beginning of loop before a loop Both A and B are Correct Both A and B are Incorrect 87. A java string is : Not Null terminated Not a character array Both A and B Are incorrect Both A and B are Correct 88. ‘color ‘ class is part of this package: java.applet java.awt java.util java,io 89. This kind of statement is used to access package : select import include method 90. If this statement is used is a java program ,what is the output ? public static void Main(string []args) It will be treated normally and program will run Compilation error runtime error It will be treated as additional main method 91. What is false about main method ? It must be declared public It must be declared static It can be overridden It can be overloaded 92. Static method belong to : class objects Both A and B are correct Both A and B are incorrect 93. Which is not true about Abstract class? There can not be any instance of abstract class Abstract class is only meant to be subclass we can not have an Abstract class without Abstract Methods Abstract class has member elements 94. A Continue statement returns control to : current loop iteration Loop statement Both A and B are correct Both A and B are incorrect 95. Layout Manager Managers not defined in java awt package is /are Flow Layout Border Layout Panel Layout All of the above 96. This method changes label of a button : Change Label (String str) Set Button (String str) Button Label (String str) Set Label (String str) 97. TheĀ self-registration of Active X controls is done by using function : Register Active X DLL register Server DLL Register Active X Register server 98. A Container can manage the lifetime of an Active X Control using: Query Interface Lifetime Interface Query Life Interface Time Interface 99. HTTP can be used to exchange : XML files HTML files Both A and B are correct Both A and B are Incorrect 100. HTTP is this kind of protocol : stateless stateful sometime stateless sometime stateful. Loading … Question 1 of 100