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) 9

  • b) 9.0

  • c) 10.0

  • d) Compilation error

Question 2 - 3 minutter

What is the value of sum?

  • a) 9

  • b) 9.0

  • c) 36

  • d) Compilation error

Question 3 - 5 minutter

What is the value of sum3

  • a) 8

  • b) 16.0

  • c) 8.0

  • d) Compilation error

Question 4 - 5 minutter

What is the value of subtraction

  • a) true

  • b) 1

  • c) 1.0

  • d) Compilation error

Last updated

Was this helpful?