|
Java example source code file (T4906100.java)
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 |
Copyright 1998-2024 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.