Instantly share code, notes, and snippets.

Embed
What would you like to do?
Java Puzzle 14 (spot the bug if one exists)
public class Puzzle14 {
public static void main(String[] args) {
char x = 'X';
int i = 0;
System.out.print(true ? x : 0);
System.out.print(false ? i : x);
}
}
@benjholla

This comment has been minimized.

Show comment
Hide comment
@benjholla

benjholla Oct 8, 2018

Adapted from Java Puzzlers: Traps, Pitfalls, and Corner Cases - Puzzle #8

Owner

benjholla commented Oct 8, 2018

Adapted from Java Puzzlers: Traps, Pitfalls, and Corner Cases - Puzzle #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment