Creates several variables, assigns them initial values, and displays two of them as output. - Java Language Basics

Java examples for Language Basics:Variable

Description

Creates several variables, assigns them initial values, and displays two of them as output.

Demo Code

public class Main {

    public static void main(String[] arguments) {
        final char UP = 'U';
        byte initialLevel = 12;
        short location = 13250;
        int score = 35100;
        boolean newGame = true;

        System.out.println("Level: " + initialLevel);
        System.out.println("Up: " + UP);
    }//w  w w .  ja va2 s.  co  m
}

Related Tutorials