public class Example { static public String parameter = "value"; public boolean check(final String value) { if( parameter.equals( value ) ) retrun true; return false; } }
try { ... } catch (IndexOutOfBoundsException e) { ... } catch (IOException e) { ... } catch (Exception e) { ... }
FileOutputStream fos = new FileOutputStream( "out.txt" ); try { fos = new FileOutputStream( "out.txt" ); fos.write("...".getBytes()); } finally { fos.close(); }
final List list = ... for (int i = 0, int size = list.size; i < size; i++) { ... }
final List list = getSomeList(); for (final Iterator iterator = list.iterator(); iterator.hasNext(); ) { final SomeObject object = (SomeObject)iterator.next(); ... }
public class Example { static public String parameter = "value"; public boolean check(final String value) { if( parameter.equals( value ) ) retrun true; return false; } }
final String name = getName(); if (!StringUtils.isEmpty(name) { ... }
public class Example { static { System.out.println("Hello, World!!!"); } }
public class Example { private Example instance = null; protected Example() { } public static Example getInstance() { if(instance == null) { instance = new Example(); } return instance; } }
if (LOGGER.isDebugEnabled()) { LOGGER.debug("Delete uset with (id =" + user.getId() + ")"); }