1. Which of the following are examples of suitable IDEs for Java?
2. There are two major components of code. These are blocks, and statements. A statement is a ________________. A block can contain multiple statements.
3. A sequence of characters is called a string. Strings in Java are enclosed in double-quotes.Identify the string in the below code:
4. The commands System.out.print and System.out.
println both are responsible for:
5. System.out.println moves the cursor to a ________ after the information has been displayed, while System.out.print does not.
6. Both these examples seek to create a class header. Which of the following statements is correct?
7. Suppose you wanted to output a string like the one shown below. What is Java's solution to this? (take special note of the fact that the word 'Java' is in quotation marks.
8. The following code shows a class called Addition that contains a:
9. What is the output of the code above?
10. Read the paragraph below and fill in the blanks.
A ________ program is a text file that contains a program
written in a programming language. Since it contains ordinary text (stored as bytes) it can not be directly executed (run)
by the computer system. As a text file, you can print it,
display it on the monitor, or alter it with a text editor.
11. Reserved words are certain keywords that have particular meaning in Java and cannot be used. Which of the following statements below is correct?
12. JVM (Java _______ Machine) is an abstract machine. It is called a _______machine because it doesn't physically exist.
13. It is possible for a processor chip to be built that executes Java bytecodes directly, just as an Intel processor chip executes its machine language directly?
14. The code below shows a class called 'Hello'. Which of the following statements are true of a class?
15. What does the figure below illustrate and confirm?
16. In the following example, lines 1,3 and 4 are examples of single (line 1) and multiline (lines 3 and 4) __________. They are not executed by the compiler.
//This is a java code snippet
public class FirstExample2 {
public static void main(String[] args) {
/* Let's declare and
print variable in java. */
int i=10;
System.out.println(i);
}
}
17. Fill in the blanks in the paragraph below. (Just type in one word that fits in each of the blanks)
_______ is a keyword. The _______ keyword is used to ______ built-in and
user-defined packages into your java source file so that your class can
refer to a class that is in another package by directly using its name
18. Which of the following options have followed the preferred naming conventions in Java?
19. The company 'Apple' has just come out with a new computer and wants this computer to run Java programs. What must Apple do?
Important note: When the Java interpreter is running on a computer system, that system acts just like a hardware Java bytecode processor. It is a Java Virtual Machine.
20. Java programs are portable, which means that the same bytecode program can run on any computer system that has a Java interpreter
21. An______ is a Java bytecode program that runs on a Web browser. Most up-to-date Web browsers include a Java interpreter.
22. If you're using an IDE like Eclipse, you'll notice a Source folder and bin folder. Fill in the blanks for the sentence below.
23. _______ are values passed to a function when the function is called. x and y in this example are ________.
public class Example {
public static int multiply(int a, int b)
{
return a + b;
}
public static void main(String[] args)
{
int x = 2;
int y = 5;
// the variables x and y are arguments
int sum = multiply(x, y);
System.out.println("SUM IS: " + sum);
}
24. There is a subtle, but important difference between arguments and parameters. For the following example, which one of these options is correct?
25. Can you save a java source file by other name than the class name?