1. Select one of the following options that best applies to you.
2. In the following code, what is the name of the package?
package hello;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
String x = new String("hello");
}
3. In the above example, 'Hello World' is the name of the ______.
We would recommend the following video if you need to brush up on your foundational knowledge. VIDEO
4. In Java, a class should be a noun and the first letter would be a capital letter.
5. A class can be thought of as a blueprint or template for an object. Classes have ______ and properties inside them.
6. Refer to the code in question 2. What is 'main'?
7. The more technical name for a class, method or property 'name' is an ______________.
8. When a class, variable or method name consists of more than one word, in Java we use an upper case letter to symbolise the beginning of a new word e.g. MyClass. This is called:
9. Referring to the code in question 2, what is System.out.println("Hello World!");?
10. How many members are present in the code in question 2?
11. The following code refers to the creation of a member inside the class, more specifically, a ______________ that simply stores a value.
12. public is an ____________. Any class from any package may use the class with a public identifier.
13. By convention, it is a good idea to never indent anything that is inside curly braces. This is required for a language like python but it is best not applied in Java.
14. With a few exceptions (e.g. creating a library or standalone module), every single java project needs a public method called _____.
15. The main method will never be executed automatically when we execute or run our program. If we change 'main' to 'rain' and have no main method, the program will still run fine.
16. In English, a dot indicates the end of a sentence. A dot in java (in this example) indicates that we want to execute or call the method 'drive' on the variable car.
17. A _____ is used to indicate the end of a statement in java - a dot is alredy used for something else, so we can't use that!
18. In Java, a static member is a member of a class that isn?t associated with an instance of a class. Instead, the member belongs to the class itself.
19. What is the output of the following program?
public class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
20. Look at line 2 of the code below. _____ is the return type of the method. It means it doesn't return any value.
public class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}