Integer Usage

int a = 4;
float b = 4;
float sub= (a - b);
System.out.println(sub);
0.0

String Usage

String x = "hetvi";
String y = "is";
String z = "in CSA period 2";
String name = x + " " + y + " " + z;
System.out.println(name);
hetvi is in CSA period 2

Boolean Usage

boolean is_so_amazing = true;
boolean is_not_amazing = false;

if (is_so_amazing){

    System.out.println("you are taking CSA!");
}

else if (is_not_amazing){

    System.out.println("you are taking another class");

}
you are taking CSA!

Solving for Potential Energy on Earth

public class PotentialEnergyCalculator {

    public PotentialEnergyCalculator() {
        this.enterVals();
    }

    private double PE; // initialize PE double. Stores the final output value.
    private double mass; // initialize mass double. Stores it from the user input.
    private double height; // initialize height double. Stores it from the user input.
    private static double g = 9.80; // initialize static double. Stores the constant value.

    private void enterVals() {

        while (true) {
            Scanner dd = new Scanner(System.in);
            System.out.print("Enter mass of object in grams: ");
            try {
                mass = dd.nextDouble();
                System.out.println(mass); // sets variable to True meaning if the double is entered correctly
                break;
            } catch (Exception e) {
                System.out.println("Not an double (form like 9.99), " + e); // if it's not a number, it will close.
            }
            dd.close();
        }

        while (true) {
            Scanner dd = new Scanner(System.in);
            System.out.print("Enter height at which object is placed in meters: ");
            try {
                height = dd.nextDouble();
                System.out.println(height);
                break;
            } catch (Exception e) {
                System.out.println("Not an double (form like 9.99), " + e);
            }
            dd.close();
        }
    }

    public double calculate() {
        double g = 9.80;
        PE = (mass*height*g); // equation for calculating potential energy
        return PE; // outputs calculated value.
    }

    public static void main(String[] args) {
        PotentialEnergyCalculator PE = new PotentialEnergyCalculator();
        System.out.println("Your potential energy in Joules is " + String.format("%.2f", PE.calculate())); // script for what the output will look like using string
    }
    
}
PotentialEnergyCalculator.main(null);
Enter mass of object in grams: 3.0
Enter height at which object is placed in meters: 4.0
Your potential energy in Joules is 117.60