Declaring constants - Java Language Basics

Java examples for Language Basics:Variable

Description

Declaring constants

Demo Code

public class Main {
  final static int One = 1;
  final static int Two = 2;

  public static void main(String[] args) {
    int Three = One + Two;
    System.out.println(Three);/*from w w w.ja  v a2  s.c o  m*/
  }
}

Result


Related Tutorials