Font size
WorksheetsPROGRAMMING CAMP
Total questions: 20
Worksheet time: 10mins
Which of the following is a CONDITIONAL
jump 5 times
if you see an arrow then jump 5 times else sit down
if you see an arrow
Which of this command is the correct way of printing in Java?
System.Out.print
System.out.Print
System.out.print
system.out.print
Which of this command has errors? Select multiple
System.out.print("Hello World")
System.out.print(Hello World);
System.out.Print("Hello World);
System.out.print("Hello World");
Which of the followings is Java code that starts from the main() method as a mandatory part of every program
public void static main(String args [])
public void main static (args[] String)
public static void main (String args[])
public static void main [String [] Args]
It is an optional statement used to describe what a program or a line of program is doing.
tag
command
code
comment
A data type which is typical in form and make use of digits and a decimal point
integer
float
char
boolean
What data type is classified as a sequenced of characters with double quotes.
Char
String
boolean
Float
True or False : Java is case sensitive, which means identifier Hello and hello would have different meaning in Java
True
False
Identifiers can start with a number. True or False?
True
False
The following Syntax is used for?
class Subclass-name extends Superclass-name
{
//methods and fields
}
Polymorphism
Encapsulation
Inheritance
None of the above
Which of the following commands will run the compiled Java program named DoItNow?
run DoItNow
java DoItNow.java
java DoItNow
go DoItNow
Assume you are at the operating system command line and want to use the following command to compile a program:
javac MyClass.java
Before entering the command you must
close all open windows on your computer system
make sure you are in the same directory or folder where the MyClass.java file is located
execute the java.sun.com program
save the program with the .comp extension
A cross between human language and a programming language is called
a compiler
pseudocode
the Java Virtual Machine
the Java language
//
/* */
'
What is the output
class Output
{
public static void main(String args[])
{
boolean a = true;
boolean b = false;
boolean c = a ^ b;
System.out.println(!c);
}
}
true
1
false
0
What is the output
class dynamic_initialization
{
public static void main(String args[])
{
double a, b;
a = 3.0;
b = 4.0;
double c = Math.sqrt(a * a + b * b);
System.out.println(c);
}
}
25.0
5.0
Error
7.0
What is the output
class bitwise_operator
{
public static void main(String args[])
{
int a = 3;
int b = 6;
int c = a | b;
int d = a & b;
System.out.println(c + " " + d);
}
}
7 7
7 2
5 2
7 5
What is the output
class OperatorExample{ public static void main(String args[]){ System.out.println(10*10/5+3-1*4/2); }}
21
44
35
103
