> For the complete documentation index, see [llms.txt](https://vives.gitbook.io/oop-with-java/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vives.gitbook.io/oop-with-java/starting-in-java/multiple_choice.md).

# Multiple Choice

1. What is the entry point of a Java application ?
   * [ ] The `start()` method
   * [ ] The file `HelloWorld.java`
   * [ ] The `main()` method
   * [ ] The Java Virtual Machine
2. What is common use of a Hello World application ?
   * [ ] Proof of concept to show a device can run user code
   * [ ] To show that code is faster with a compiler
   * [ ] To check if your application contains bugs
   * [ ] Test if a programming language is object oriented
3. How do we call a line of code that performs a specific action and is terminated with a semicolon ?
   * [ ] A condition
   * [ ] An escape sequence
   * [ ] A method
   * [ ] A statement
4. Code in `main()` is placed between ...
   * [ ] slashes `//`
   * [ ] curly brackets `{}`
   * [ ] parentheses `()`
   * [ ] brackets `[]`
5. When we expect a positive integral value from the user and he/she inputs a negative number, than this may lead to a ...
   * [ ] Syntax error
   * [ ] Runtime error
   * [ ] Logic error
   * [ ] Grammatical error
6. When we want to add double quotes inside our string that is outputted to the terminal we need to make use of ...

   ```
    Hello, my name is "Nico De Witte"
   ```

   * [ ] `\t`
   * [ ] `\x`
   * [ ] `\'`
   * [ ] `\"`
7. What code statement can be used to output our name and age to the terminal as shown below ?

   ```
    Hello, my name is Nico and I am 32 years of age.
   ```

   * [ ] `System.out.println("Hello, my name is Nico and I am " + 32 + " years of age.");`
   * [ ] `System.out.println('Hello, my name is Nico and I am ' + 32 + ' years of age.');`
   * [ ] `System.out.println("Hello, my name is Nico and I am " 32 " years of age.");`
   * [ ] `System.out.println("Hello, my name is Nico and I am " + 32 + ' years of age.')`
8. The rectangle's (process step) in a flowchart will often map on ... in Java.
   * [ ] a condition
   * [ ] an escape sequence
   * [ ] a statement
   * [ ] a method
9. When we forget to place a curly brace than we create a ...
   * [ ] bug
   * [ ] runtime error
   * [ ] syntax error
   * [ ] system fault
10. How do we call `\n`, `\t`, `\r` ?
    * [ ] Insert characters
    * [ ] Terminators
    * [ ] Strings
    * [ ] Escape characters
11. How do we call a piece/line of code as shown below?

    ```java
    System.out.println("Single line of code here");
    int number = 15;
    double size = number * 3.3;
    ```

    * [ ] Decisions
    * [ ] Statements
    * [ ] Conditions
    * [ ] Operators
12. What is not a use of creating a basic "Hello World" application?
    * [ ] It's an ideal introduction for beginning programmers
    * [ ] Useful to check if your development tools (IDE, compiler, ...) are configured/working as they should
    * [ ] Ideal to check if a programming language supports object oriented concepts
    * [ ] Used by hackers as a proof-of-concept to show that arbitrary code can be run on certain devices
13. When we forget to place a semicolon `;` at the end of a statement, then we create a ...
    * [ ] bug
    * [ ] runtime error
    * [ ] syntax error
    * [ ] system error
14. What is the problem with the code below?

    ```java
    public static void main(String[] args) {
        int sum;
        System.out.println("Sum = " + sum);
    }
    ```

    * [ ] It contains a variable that was not initialized
    * [ ] It contains a variable that was not declared
    * [ ] It contains a syntax error
    * [ ] It contains a variable with a wrong datatype
15. Suppose you write an application that needs to generate a list of numbers between 0 and 100 (both inclusive, so `[0, 100]`). However, the application generates values `100` exclusive, so `[0, 100[`. De app does run without crashing. What kind of error did you make?
    * [ ] A bug
    * [ ] A syntax error
    * [ ] A runtime error
    * [ ] If the app does not crash, it is ok
16. What is the problem with the code below?

    ```java
    public static void main(String[] args) {
      int numberOfPeople = 15;
      System.out.println(There are + numberOfPeople + in the building);  
    }
    ```

    * [ ] A variable that was not declared
    * [ ] A syntax error
    * [ ] An uninitialized variable
    * [ ] An incorrect datatype for the variable
17. What is the result of the following statement?

    ```java
    System.out.println("The total is " + 88 + 12 + " euro.");
    ```

    * [ ] The total is is 88 + 12 euro.
    * [ ] The total is is 8812 euro.
    * [ ] The total is is 100 euro.
    * [ ] The total is is euro.
