##This is a reply to a thread, when I clicked reply it created its own thread and there is no delete thread##
Continuing the discussion from What is your favorite java code formatting?:
If statements
if (A == 0) {
//something
}else if (string.equals("something")) {
//something else
}
Try/Catch##
try{
//try
}catch(IOException e){
e.printStackTrace();
}
imports
import org.bukkit.dev.someclass;
import org.bukkit.dev.someotherclass;
import com.spongepowered.someclass;
##long if (I know this example isn’t long, this would probably be on the same line)##
if ((A == A)
|| (B == B)
|| (C == C)) {
//do something
}
##long code (formatting messed up … its all on a single line)##
String string = hello.getLocation().add(0,0,0).getBlock().getType().name()
##list for breakdown##
for(String example : List<String>){
//something
}