Tuesday
This week will be focused on Java basics
Read and solve the exercises found in Methods
Peer instruction
Question 1 - 3 minutter
What is the value of numberOfCharacters?
public class Question1 {
public static void main(String[] args) {
double numberOfCharacters = getNumberOfCharacters("Kea er sej");
}
public static int getNumberOfCharacters(String word) {
System.out.println(word.length());
}
}a)
9b)
9.0c)
10.0d) Compilation error
Question 2 - 3 minutter
What is the value of sum?
a)
9b)
9.0c)
36d) Compilation error
Question 3 - 5 minutter
What is the value of sum3
a)
8b)
16.0c)
8.0d) Compilation error
Question 4 - 5 minutter
What is the value of subtraction
a)
trueb)
1c)
1.0d) Compilation error
Last updated
Was this helpful?