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

Java example source code file (T4906100.java)

This example Java source code file (T4906100.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

suppresswarnings, t4906100

The T4906100.java Java example source code

/*
 * @test  /nodynamiccopyright/
 * @bug 4906100
 * @summary detect empty statement after if
 * @compile/ref=T4906100.out -XDrawDiagnostics -Xlint:empty T4906100.java
 */

class T4906100 {
    void f1(int a, int b) {
        if (a == b);
            System.out.println("a == b");
    }

    @SuppressWarnings("empty")
    void f2(int a, int b) {
        if (a == b);
            System.out.println("a == b");
    }

    // check that { } is not treated as an empty statement
    void f3(int a, int b) {
        if (a == b) { }
            System.out.println("a == b");
    }
}

Other Java examples (source code examples)

Here is a short list of links related to this Java T4906100.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.