File: Constants.java

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (25 lines) | stat: -rw-r--r-- 960 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.28
public class Constants {
    public static final int ConstInt = 1;

    public static final int ConstIdent = ConstInt;
    public static final int ConstSelect = Constants.ConstInt;

    // this is a known limitation in scala's javac parser for constants, it will be treated as -1.
    // the java compiler will flag an error.
    public static final int NegatedInt = !1;

    public static final int     ConstOpExpr1 = 1 + 2;
    public static final int     ConstOpExpr2 = 1 << 2;
    public static final boolean ConstOpExpr3 = 1 == 1;
    public static final int     ConstOpExpr4 = true ? 1 : 2;

    public static int NonFinalConst = 1;
    public final int NonStaticConst = 1;
    public int NonConst = 1;

    public static final short   ConstCastExpr = (short)(1*2*3*4*5*6);

    public static final String ConstString = "a";
    public static final String StringAdd = "a" + 1;
}