Java Expressions
Java Language
Computer science but math
Networking / Hardware
Miscellaneous
1

What is the value of the following expression?

3 - 5 * 3 / 3

-2

1

What are the two primitive types that allow for non-integer values?

float or double

1

What is the name of the sequence where each number is the sum of the previous two, beginning with 0, 1, ...

The Fibonacci sequence.

1

What does http stand for?

Hypertext transfer protocol.
1

What isn't the name of base 2?

Anything but "binary".

2

What is the value of the following expression?

(8 % 3) % (7 % 6)

0

2

What is the capitalization convention for typical java variables called? (for example, aVariableName)

camelCase

2

What is the greatest common divisor of 30 and 12?

6

2

What is the quantum equivalent of a binary bit?

A qubit.

2
What is the room number of this room? (letter and number)
A101
3

What are the boolean values a, b, and c if the following expression is true?

(a && b || c & & a) && !(a && c || c)

a is true, b is true, c is false.

3

What is the mechanism that Java uses to automatically reclaim memory occupied by objects that are no longer reachable?

Garbage collection.

3

This graph has 7 vertices, with an edge between each vertex. How many edges are there?

21

The general formula for n vertices is n(n-1)/2 (which is similar to the triangle number formula).

3

What is a Cross-Site Scripting (XSS) attack?

An attacker injects malicious JavaScript code into a website, causing the code to run in another user's browser.

3

What is 101012 in decimal?

21.

4

What is the value of the following expression in binary?

0b1010 << 2 + 1

1010000

4

What keyword is used to skip the current iteration of a loop?

continue

4

What is the millennium prize problem that asks if all problems with quickly verifiable solutions can be quickly solved?

P versus NP problem.

4

What do HTTP status codes beginning with 4 signify? (For example, 404 or 403)

A client error.

4

How many student computer monitors are in this room?

29.

5

What does this code print?

int a = 3;

System.out.println(a = 5 == 5 ? a : 2*a);


3

5

What does the goto keyword do in Java?

Nothing.

5

What is a Hamiltonian path?

A path that visits each vertex exactly once.

5

Order these digital storage units by ascending number of bits (smallest to largest):

  • Terabyte
  • Gigabyte
  • Yottabyte
  • Zettabyte
  • Petabyte
  • Exabyte 
  • Gigabyte
  • Terabyte
  • Petabyte
  • Exabyte 
  • Zettabyte
  • Yottabyte
5

What is the name of base 4?

Quaternary