
computer application set2
Quiz by Tritesh Pandey
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
1) Java is a Successor to which programming language?
2 Who invented Java language?
3 Which company owns Java at present?
4 What software runs a Java program on a computer?
5 What is the need to mention "static" before main method?
6 In standalone Java applications, which method is mandatory?
7 Choose a Single Line Comment in Java Language below?
8 String args[] in main method are used for?
public static void main(String args[])
{
//
}
9 Name of a Class, Variable, Method or an Interface in Java language is called?
10 A valid identifier in Java language may contain which characters?
11 An if_else statement is also called ___.
12 The condition of an IF statement evaluates to boolean only if the expression contains?
13 If the condition of an IF-statement is false, which is true below.
14 What is maximum lines of code that can be written inside a Java style IF, ELSE or IF-ELSE block?
15 Choose the correct syntax of Java IF statement below.
16 What is the output of Java program with IF statement?
if(1)
{
System.out.println("OK");
}
17 String name1="FOX", name2="DOG";
if(name1 == "FOX")
System.out.print("FOX ");
System.out.println("GOOD");
if(name2 == "CAT")
System.out.println("DINO");
18 int marks=85;
if(marks >= 80)
System.out.println("DISTINCTION");
else if(marks >=35)
System.out.println("PASS");
19 long num = 123L;
if(num > 123)
{
System.out.println("TIGER");
}
else{ System.out.println("BIRD");}
20 int horses = 10;
int camels = 5;
if(horses < 5){ System.out.println("TOWN");}
else if(horses >=5)
System.out.print("FOREST ");
System.out.println("AMAZON");
else
System.out.println("UNKNOWN");
21 A Java method is comparable to a __ in c language.
22 All Java methods must have a return type. (TRUE / FALSE)
23 Java method signature is a combination of ___.
24 In Java, a method name can not start with a ___.
25 In Java, a method name can start with ___.
26 In Java, a method name can contain numbers from 2nd character onwards. (TRUE / FALSE).
27 public class TestingMethods3
{
void show2()
{ System.out.println("SHOW Method 2"); }
public static void main(String[] args)
{ TestingMethods3 t3 = new TestingMethods3();
t3.show2(); }
}
28 Java does not allow nesting of methods. (TRUE / FALSE)
29 What does a Data Type in Java refers to?
30 Choose the wrong statement about Java programming?
31 Which data type among the following is an implementation of Objects or OOPs?
32 Choose the Compound Assignment Arithmetic Operators in Java below.
33 What is the output of the below Java code snippet?int a = 2 - - 7;
System.out.println(a);
34 What is the output of Java code snippet below?short p = 1;
short k = p + 2;
System.out.println(k);
35 What is the output of Java code snippet?
short k=1;
k += 2;
System.out.println(k);
36 What is the output of the Java code snippet?
int a=5, b=10, c=15;a -= 3;b *= 2;c /= 5;
System.out.println(a +" " + b + " " + c);
37 Which is the arithmetic operator in Java that gives the Remainder of Division?
38 Arithmetic operators +, -, /, * and % have which Associativity?
39 Increment and Decrement arithmetic operators in Java has which Associativity?
40 Choose the correct statement about Java Operators +, -, *, / and %.