Java examples for Language Basics:int
even if you assign it to a double variable. For example:
public class Main { public static void main(String[] args) { int a = 21, b = 6; double answer = a / b; // answer = 3.0 System.out.println(answer);// w ww . j a va 2 s .c o m } }