Bits
Bits
c) str.convertToLower() ( )
d) str.makeLowerCase()
a)do-while CO1,
Remember ( )
b)while
c)for
d) none of the mentioned
5 What is an interpreter?
class Parent
void show()
}
CO2,
class Child extends Parent Apply
void show()
}
}
class Main
obj1.show();
}
}
a) He
b) Hel
c) lo
d) llo
5 What is the return type of a method that does not return any value?
a) int
CO1
b) float ( )
Remember
c) void
d) double
6 Which of these jump statements can skip processing the remainder of the CO1
code in its body for a particular iteration? Remember
a) break
b) return ( )
c) exit
d) continue
7 Which of the following is not a valid jump statement? ( )
a) break CO1
b) goto Remember
c) continue
d) return
8 Which one of the following is not an access modifier?
a) Public CO2
b) Private Remember
c) Protected ( )
d) Void
a)intf CO2
b)Intf Remember ( )
c)interface
d)Interface
{
public static void main(String args[])
{
String s1 = "java";
String s2 = "java"; CO3
Apply
System.out.println(s1.equals(s2));
}
}
a)false
b)true
c)compile time error
d)run time error
System.out.println(s1.indexOf('W'));
a)1 CO3 ( )
Apply
b)true
c)6
d)false
class MainProgram
{
public static void main(String args[])
{
CO3
StringBuffer s1 = new StringBuffer("Hello"); Apply
s1.insert(1,"Java");
System.out.println(s1); ( )
}
}
a) hello
b) java
c) Hello Java
d) HJavaello
}
}
a)varri
b)naidu
c)varri naidu
d)compile time error
a) length()
CO3
Remember ( )
b) Length()
c) capacity()
d) Capacity()
20 How do you convert a string to lowercase in Java?
a) str.toLower()
b) str.toLowerCase() CO3
( )
Remember
c) str.convertToLower()
d) str.makeLowerCase()
Answer all questions and each question carries 1Mark.
1 Who invented Java Programming?
a) Guido van Rossum CO1,
b) James Gosling Remember ( )
c) Dennis Ritchie
d) Bjarne Stroustrup
2 Which statement is true about Java?
a) Java is a sequence-dependent programming language CO1
b) Java is a code dependent programming language Remember ( )
c) Java is a platform-dependent programming language
d) Java is a platform-independent programming language
3 Which component is used to compile, debug and execute
the java programs?
a) JRE CO1
Remember ( )
b) JIT
c) JDK
d) JVM
4 Which one of the following is not a Java feature?
a) Object-oriented CO1
b) Use of pointers Remember ( )
c) Platform independent
d) Robust
5 What is the extension of java code files?
a) .js CO1
b) .txt Remember ( )
c) .class
d) .java
6 Which of these are selection statements in Java?
a) break CO1
b) continue Remember ( )
c) for()
d) if()
7 Modulus operator, %, can be applied to which of these?
a) Integers CO1
b) Floating – point numbers Understand ( )
c) Both Integers and floating – point numbers
d) None of the mentioned
8 Decrement operator (−−) decreases the value of variable by what
number? CO1
a) 1 Remember
b) 2 ( )
c) 3
d) 4
a) Inheritance CO2
( )
b) Encapsulation Remember
c) Polymorphism
d) Compilation
16 What will be the output of the following Java program? ( )
class Test
{
public static void main(String args[]) CO2
{ Apply
int number=20;
if(number%2==0)
{
System.out.println(“even number”);
}
}
}
a)compile time error
b)run time error
c)even number
d)20
17 What is the return type of a method that does not return any value?
a) int
CO2
b) float ( )
Remember
c) void
d) double
19 Which of the following is a method having same name as that of its class?
a) finalize
CO2
b) delete ( )
Remember
c) class
d) constructor