Q. Which of the following falls under the key element of
programming?(Multiple choice) a) Good analytical skill b) Declarative knowledge c) Imperative knowledge d) Abstract knowledge in programming Q. IDE stands for? Ans: Integrated Development Environment Q. Which component is used to compile, debug and execute the java program? a) JIT b) JRE c) JVM d) JDK Q. _____ also known as the static variable? a) class variable b) Instance variable c) local variable d)all of the above Q. Which is not OO Concept? a) Polymorphism b) Inheritance c) Compilation d) Inheritance Q. Which of the following operators will return a true value with one operand as false? (Multiple choice) a) NOT b) AND c) OR Q. Which of these is long data type literals? a) 0x99fffL b) ABCDEFG c) 0x99ffa d) 99671246 Q. Which of the following can not be used for a variable name in Java? a) identifier b) keyword c) identifier & keyword d) None of the mentioned Q. Which of these is an incorrect string literal? a) "Hello World" b)"Hello\nWorld" c) "\"Hello World\"" d) "Hello World" Q. The expression in a switch statement can contain logical operators? a) True b) False Q. Which of these keywords cannot be used for a class which has been declared final? a) abstract b) extends c) abstract & extends d) none of the mentioned Q. Which of these classes is a superclass of every class in java? a) string class b) object class c) Abstract class d)ArrayList class Q. Which of these keywords can be used to prevent the inheritance of class? a) super b) constant c) class d) final Q. What should be expressions evaluated to in using the ternary operator as in this line? expression1?expression2:expression3 a) integer b) floating c) boolean d) None of the mentioned Q. If you want a data member to not be accessible from outside class how should you mark it. a) private b) public c) protected d) defalut Q. Which of these keywords is used to refer to member of the base class from a subclass? Ans: super Q. JRE stands for Java _______ Environment? Ans: Runtime Q. Which of these operators are used to allocate memory to array variable in java? Ans: new Q. _____ is called as the super class of all classes? Ans: java.lang.Object Q. To find the length of the string: String a; Ans: a.length(); Q. Object Includes? a) attribute b)behaviour c) both d)None Q. Predict the output of the program String str = "I Like JAVA"; System.out.println(str.length()); a) 12 b) 11 c) 10 d) 9 Q. What is the extension of java code file? a) .java b) .class c) both a and b d) .txt Q. What is the extension of compiled java classes? a) .java b) .txt c) .class Q. Strings in java are mutable? a) true b) false Q. What modifier can be used to restrict a method or attributes to be invisible outside its package? a) public b) Protected c) Private d) Default(No modifier) Q. If the package name containing more than one word is used, the word must be separated by a) comma b) dot c) hyphen d) underscore Q. All the classes in a package can be simultaneously imported using Ans: *(asterisk)