I am a beginner learning Java and this is a calculator program I've made. I'm looking for suggestions to improve it and things I could've done better. I don't know OOP principles much, so any and all suggestions are welcome.import java.util.Scanner;    public class BasicCalci {        Scanner sc = new Scanner(System.in);        int x = 0;        int choice = 0;        Maths m = new Maths();        public static void main(String[] args) {            BasicCalci ob = new BasicCalci();            ob.menu();        }    public void menu() {        System.out.println(    Basic Calculater      );        System.out.println();        System.out.println(1. Add.);        System.out.println(2. Subtract.);        System.out.println(3. Multiply.);        System.out.println(4. Divide.);        System.out.println(5. Square Root.);        System.out.println(6. Exponent.);        System.out.println(7. Prime Check.);        System.out.println(8. HCF.);        System.out.println(9. LCM.);        System.out.println(10. Exit.);        choice = sc.nextInt();        accepter(choice);    }    public void accepter(int c) {        double a, b;        switch (c) {        case 1: {            System.out.println(Enter the numbers you want to Add.);            a = sc.nextDouble();            b = sc.nextDouble();            add(a, b);            break;        }        case 2: {            System.out.println(Enter the numbers you want to Subtract.);            a = sc.nextDouble();            b = sc.nextDouble();            subtract(a, b);            break;        }        case 3: {            System.out.println(Enter the numbers you want to Multiply.);            a = sc.nextDouble();            b = sc.nextDouble();            multiply(a, b);            break;        }        case 4: {            System.out.println(Enter the numbers you want to Divide.);            a = sc.nextDouble();            b = sc.nextDouble();            divide(a, b);            break;        }        case 5: {            System.out.println(Enter the number for Square Root.);            a = sc.nextDouble();            sqrt(a);            break;        }        case 6: {            System.out.println(Enter the base number and then its power.);            a = sc.nextDouble();            b = sc.nextDouble();            exp(a, b);            break;        }        case 7: {            System.out.println(List: Enter the starting and ending numbers of the range.);            System.out.println(Single: Enter the same number twice to check if it is Prime.);            a = sc.nextInt();            b = sc.nextInt();            System.out.println();            m.primeList(a, b);            break;        }        case 8: {            m.hcfLcm(choice);            break;        }        case 9: {            m.hcfLcm(choice);            break;        }        case 10:{            System.out.printf(\nThank You \n-Shekhar Verma );            break;        }        default:            System.out.print(Wrong Choice.\n\n);            menu();        }    }    public void sqrt(double a) {        System.out.printf(Result : %.2f, (Math.sqrt(a)));    }    public void add(double a, double b) {        System.out.printf(Result : %.2f, (a + b));    }    public void subtract(double a, double b) {        System.out.printf(Result : %.2f, (a - b));    }    public void divide(double a, double b) {        System.out.printf(Result : %.2f, (a / b));    }    public void multiply(double a, double b) {        System.out.printf(Result : %.2f, +(a * b));    }    public void exp(double a, double b) {        System.out.printf(Result : %.2f, +(Math.pow(a, b)));    }}import java.util.Scanner;public class Maths {    public void hcfLcm(int c) {        Scanner sc = new Scanner(System.in);        System.out.println(Enter the two numbers.);        int a = sc.nextInt();        int b = sc.nextInt();        System.out.println();        int hcf = 0;        int min = Math.min(a, b);        for (int i = min; i >= 1; i--) {            if (a % i == 0 && b % i == 0) {                hcf = i;                break;            }        }        if (c == 8)            System.out.println(HCF :  + hcf);        else            System.out.println(LCM :  + (a / hcf) * (b / hcf) * hcf);        sc.close();    }    public void primeList(double a, double b) {        int pcount = 0;        int count = 0;        for (double x = a; x <= b; x++) {            for (int d = 1; d < x; d++) {                if (x % d == 0) {                    count++;                }                if (count > 1)                    break;            }            if (count == 1) {                if (a == b) {                    System.out.print((int) a +  is a Prime nummber.);                    pcount++;                } else {                    pcount++;                    System.out.print((int) x + \t);                    if (pcount % 8 == 0) {                        System.out.println();                    }                }            }            count = 0;            if (a == b && pcount == 0) {                System.out.println((int) a +  is not a Prime number.);            }        }        if (pcount % 8 != 0)            System.out.println(\n);        else            System.out.println();    }}
Calculator (Java)
java;beginner;calculator