Java examples for Language Basics:Variable
For example, the following code declares variables named x and y, and initializes x to 5 and y to 10:
public class Main { public static void main(String[] args) { int x = 5, y = 10; /*from ww w . j a va 2 s .c om*/ System.out.println(x); System.out.println(y); } }