alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (T6304921.java)

This example Java source code file (T6304921.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

arraylist, error, list, t6304921, util

The T6304921.java Java example source code

/*
 * @test (important: no SCCS keywords to affect offsets in golden file.)  /nodynamiccopyright/
 * @bug 6304921
 * @compile/fail/ref=T6304921.out -XDcompilePolicy=bytodo -XDrawDiagnostics -Xjcov -Xlint:all,-path -Werror T6304921.java
 */

import java.util.ArrayList;
import java.util.List;

class T6304921 {
    void m1(int i) {
        switch (i) {
        case 1:
            i++;
            // fallthrough
        default:
        }

        try {
            i++;
        }
        finally {
            throw new Error();
            // finally does not complete normally
        }
    }

    void m2() {
        List<Integer> list = new ArrayList();
    }
}

class X {
    void m1() {
        System.orr.println("abc"); // name not found
    }
    boolean m2() {
        return 123 + true; // bad binary expression
    }
}

Other Java examples (source code examples)

Here is a short list of links related to this Java T6304921.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.