Revising Quadratic Equations

import java.util.*;
public class Main {
public static void main(String[] args){
printRoots();
}
public static void printRoots(int a, int b, int c){

    int d = (b * b) - (4 * a * c);

    int root1 = 0;
    int root2 = 0;

    if(d < 0){
        System.out.println("Imaginary");
        return;
    }

    if(d == 0){

        System.out.println("Real and Equal");
    }else if(d >0){
        System.out.println("Real and Distinct");
    }

        root1 = (int) ((- b - Math.sqrt(d)) / (2 * a));
        root2 = (int) ((- b + Math.sqrt(d)) / (2 * a));

    System.out.println(root1 +" "+root2);

}

}

help me

Take long data type everywhere. That is what is causing integer overflow problems for you.