Primitives

  • Basica bread and butter variable types(ie: String, int, etc.)

Wrapper Classes

  • Wrappers usually uppercase in defining variable
  • Most in Java is OOP exclude primitives

Hacks

import java.util.*;

public class SimpleCalculator {
    public static void main(String[] args) {   
        Scanner input1 = new Scanner(System.in);
        System.out.println("Enter an integer for joe: ");
        int joe = input1.nextInt();
        input1.close();

        Scanner input2 = new Scanner(System.in);
        System.out.println("Enter a integer for joey: ");
        int joey = input2.nextInt();
        input2.close();

        double amogus = (double) joe + joey;

        String joseph = "Hello I am Joseph";

        System.out.println("I want to add joe and joey");

        Scanner input3 = new Scanner(System.in);
        System.out.println("Do I add joe and joey(True/False): ");
        boolean joel = input3.nextBoolean();
        if(joel){
            System.out.println(joseph + ", if I add joe(" + joe + ") and joey(" + joey + ") it gets me " + amogus);
        }else{
            System.out.println("I guess joe and joey will never meet. The name's Joseph by the way");
        }

    }
}
SimpleCalculator.main(null);
Enter an integer for joe: 
Enter a integer for joey: 
I want to add joe and joey
Do I add joe and joey(True/False): 
Hello I am Joseph, if I add joe(12) and joey(123) it gets me 135.0

Seconds to Fortnight Converter

import java.util.*;

public class main{
    public static double fortnightConverter(double fortnight) {
        double days = fortnight*14;
        double seconds = days * 86400;
        return seconds;
    }

    public static void main(String[] args){
        Scanner input = new Scanner(System.in);

        System.out.println("How many fortnights?: ");
        double fortnight = input.nextDouble();
        System.out.println(fortnight + " fortnight in seconds is: " + fortnightConverter(fortnight));
        
    }
}

main.main(null);
How many fortnights?: 
1.0 fortnight in seconds is: 1209600.0