File: file.java

package info (click to toggle)
gtksourceview5 5.18.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,780 kB
  • sloc: ansic: 71,161; xml: 1,493; javascript: 866; perl: 216; sh: 144; java: 49; php: 48; yacc: 45; ruby: 38; ml: 36; python: 33; sql: 30; makefile: 23; cobol: 20; objc: 19; lisp: 19; fortran: 14; awk: 9; cpp: 8
file content (62 lines) | stat: -rw-r--r-- 1,467 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// This file should compile and execute

import static java.lang.System.out;

interface I {
    void foo();
    String[] bar(boolean okay);
}

abstract class C implements I {
    public static void println(String str) {
        out.println(str);
    }

    @Override
    public void foo() {}
}

enum E { YEAH }

/** Do you document your API?
 * @param fake Oh no!
 * @return What?
 */
record R<T>(int i, double d, char c, Object o, T special) {
    private static final byte thing = 0;
}

public final class /* the same as the file name */ file extends C {
    @Override
    public String[] bar(boolean okay) {
        return new String[] {
            "Float: " + 1f + " or " + 1.e+0f,
            "Double: " + 1d + " or " + 1.0e-0d,
            "Long: " + 1L + " or " + 0x1l,
            "Unsigned: don’t exist in Java",
            "Escaped chars: \\ \" \101 " + '\141',
            """
            Multiline string:
                - One
                - Two
                - Three""",
        };
    }

    public static void main(String[] args) {
        println(E.YEAH.toString());
        var me = new file();
        me.foo();
        for (var wysiwyg: me.bar(false)) {
            println(wysiwyg);
        }
        while (me != null) {
            me = null;
        }
        var what = switch ("hey") {
                case "" -> "";
                default -> { yield "Have fun\u0021"; }
            };
        println(what.toUpperCase());
    }
}