WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

Beginning Java with BlueJay online Test

What is a variable?
A variable is the value a user inputs.
A variable is an unknown value in an equation.
A variable is a datatype.
A variable can hold a value based on its datatype.
This statement will not throw an error (True or False)- String newvalue=5;
True
False
Can you assign any value to a variable?
No. You can assign any variable to only a String variable.
Yes. Variables are memory locations, and you can place any value in that particular memory location.
No. You can only assign a value to its respective type of variable.
None of the above.
What is a method?
A method is a section of code that receives an input, and might return an output.
A method is similiar to a function in math.
A method is used to break down the code in easily manageable parts.
All of the above.
What is the Java command to print 'test' to the console (Pick the one with the correct syntax)?
System.out.println('test');
System.out.println('test')
System.println('test');
None of the above
What does the command 'new' do?
The new command is a type of a variable.
The keyword 'new' will allocate some RAM
The keyword 'new' will create a new object for you and initialize all its fields to zeros/nulls
Only 2 and 3.
None of the above.
What does null mean (Select the best answer)?
Null means that the variable is empty.
It will cause a null pointer exception.
A null value means that the variable has no value or that the value doesn't exist.
None of the above.
What is one way to get input from a user?
You can use the JOptionPane.InputDialog.
You can ask the user to input a value.
You can use the Input Object.
You can use the JOptionPane.showInputDialog.
What does import do?
Import will import the needed libraries for the class you are going to use.
Import will get input from a user.
Import is not a Java command.
Only 1 and 2.
Where is the syntax error in this program (Ignore the line numbers)? 1) int x=0; 2) x=x+5; 3) y=5; 4) y=y+x; 5) System.out.println('The value is: '+y);
Line 1
Line 2
Line 3
Line 4
Line 5
What is the multiplication command in Java?
>
/
*
@
What is printed to the console? int y=0; int x=2; y=10; y=10/x; x=5; y=y*x; System.out.println(y);
2
30
5
25
What will print to the console? String myString=”1”; String myString2=”2”; String newString=myString+myString2; System.out.println(newString);
3
12
1
2
What is the correct way to comment your code? a) /** * This is a comment */ b) --This is a comment c) //This is a comment d) **This is a comment
Choice a and c
Choice a and b
choice b and d
choice c and d
How to you handle an error in Java?
You should use a block statement.
You should let Java handle the errors.
You should use a try-catch Block.
None of the above.
The main method is the starting of a Java program (True or False)?
True
False
What is a syntax error?
Your code has an error
Your code has an error when compiling
All of the above
None of the above
What is the best way to print “this is a test” 5 times? a) System.out.println(“this is a test”); System.out.println(“this is a test”); System.out.println(“this is a test”); System.out.println(“this is a test”); System.out.println(“this is a test”); b) for(int x=0;x<5;x++) { System.out.println('this is a test'); }
Choice a
Choice b
None of the above
All of the above
What does this code do? int x=0; for(x=0;x<5;x++) { if(x==5) { System.out.println(“this is a test”); } } System.out.println(x);
It will print 5 to the console.
It will do nothing.
It will print 4 to the console.
It will print “this is a test” to the console.
What will this block of code do? String inputValue='5r'; Integer count=0; try { count=new Integer(inputValue).intValue(); System.out.println(count): } catch(NumberFormatException e) { System.out.println(“You received an error.”); }
It will print 5 to the System console.
It will print “You received an error” to the System console.
It will print 5r to the System console.
It will print, “NumberFormatException”.


































































































Description:

This test is for my Beginning Java part 1 class which covers installing Java and BlueJay, variables, datatypes, basic understanding of methods and functions, creating a workspace with BlueJay, compiling and running an application, basic understanding of classes and objects, Errors, Try-Catch blocks, math, Strings, For loops, and if-else statements.

Tags:

Java  BlueJay  Beginning

Comments
roger
By: roger
829 days 19 hours 14 minutes ago

corrent:60%

roger
By: roger
829 days 19 hours 13 minutes ago

I can't see the answer

Rohit
By: Rohit
820 days 13 hours 38 minutes ago

got 100% correct

Manikandan
By: Manikandan
778 days 7 hours 48 minutes ago

some of the answer were wrong in this test

Kalyan Sarkar
By: Kalyan Sarkar
752 days 22 hours 7 minutes ago

Hi Mani, why don't you report error against the wrong question; option is available in each question.

bharath
By: bharath
742 days 9 hours 11 minutes ago

i answered 13,,,,,, its nice

anil
By: anil
649 days 9 hours 54 minutes ago

Can u please provide the answers description???
so that it willl be more and more usefull..

srinadh
By: srinadh
508 days 10 hours 37 minutes ago

i answered 17 but 19 question answer is 1 that prints 5 to console i practically tested.so i lose 1 mark.

Gaurav
By: Gaurav
379 days 23 hours 40 minutes ago

Nice set of que .. thanks.

Sarvesh Rajbhar
By: Sarvesh Rajbhar
376 days 6 hours 18 minutes ago

it is not opening..........

ramabrahmam
By: ramabrahmam
182 days 11 hours 32 minutes ago

in question no 5 you gave System.out.println('test');but i think actually its argument should be string i mean System.out.println("test")...please tell me correct one

ramabrahmam
By: ramabrahmam
182 days 11 hours 32 minutes ago

in question no 5 you gave System.out.println('test');but i think actually its argument should be string i mean System.out.println("test")...please tell me correct one

sonal
By: sonal
149 days 15 hours 26 minutes ago

its not opening

sonal
By: sonal
149 days 15 hours 10 minutes ago

pls give correct ans list also......so dat will knw wat went wrong...

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subject you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
1 Member Recommends
9 Followers

Your Facebook Friends on WizIQ

More Tests By Author

HTML with Javascript
20 Questions | 700 Attempts

Beginning Java with Eclipse and Ant Part 1
15 Questions | 117 Attempts

Explore Similar Courses

Develop Android Apps with Java

Price:$295
$10

SAVE 96%

JavaServer Faces Primer

Price:$300
$200

SAVE 33%