Java Facts
Syntax
Reading Code
Error!
Grab Bag
100

When was Java released?

1995

100

How would you set a new boolean variable called codingIsFun to true?

boolean codingIsFun = true;

100

int zombies = 5;

sets the number of zombies to 5

100

boolean bugs = 10;

wrong data type (should be integer)

100

Where are the horses?

In the back

200

What company now owns Java?

Oracle

200

How would you print a line that says "Ruby is a very cool teacher" to the console?

System.out.println("Ruby is a very cool teacher");

200

System.out.println("Hello World!");

prints "Hello World!" to the console

200

int cats = 5.25;

wrong variable type (should be double)

200

Name three variable types

Possible answers: int(eger), double, String, float, boolean

300

What version of Minecraft do we usually run at this camp?

Java!

300

What is the correct format for an "if" statement?

if (condition) {

//then do this;

}

300

#000000

Black

300
string fruits = "apples and bananas";

wrong capitalization (should be String)

300

Why are unicorns so big? (question by Charlotte)

Because they could have a baby

400

What is Ruby's go-to coffee (Java) order?

Tea.

400

How do you write a "for" loop that iterates through an array and adds 1 to each element in the array?

for (var i = 0; i<arr.length; i++){

   arr[i]++;

}

400

#00FF00

Lime green

400

if (bugs>0){

   System.out.println("Ew! I hate bugs!");

else {

   System.out.println("So glad there are no bugs here!");

}

Missing curly bracket

400

What's in the picture in the tree?

A woman and a cow

500

What does OOP stand for?

Object-oriented programming!

500

How would you write a method that returns an integer that is 5 greater than the integer you put into it?

public void add5(int num){

return num+=5;

}

500

int[] spotsOnLadyBugs = new int[4];

for (var i=0; i<spotsOnLadyBugs.length; i++){

   spotsOnLadyBugs[i]=(i-2)*3

   System.out.println(spotsOnLadyBugs[i] + " spots!");

}

prints

-6 spots!

-3 spots!

0 spots!

3 spots!

500

if (bugs>0) {

   if (bugSpray){

       System.out.println("Spray the bugs!");

   }

   if (everything =="okay")

      System.out.println("Everything is okay.");

   }

}

Missing curly bracket

500

Why do unicorns have a horn? (This question proposed by Eva/Eva/Gabby/Gabriela)

Because they have a horn at the end of their name

M
e
n
u