Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyClass {
- private final int counter;
- public MyClass(final int counter) {
- this.counter = counter;
- }
- }
- class MyClass {
- private final int counter;
- public MyClass() {
- this(0);
- }
- public MyClass(final int counter) {
- this.counter = counter;
- }
- }
- public class Deck {
- private final static List<String> SUITS;
- static {
- List<String> list = new ArrayList<String>();
- list.add("Clubs");
- list.add("Spades");
- list.add("Hearts");
- list.add("Diamonds");
- SUITS = Collections.unmodifiableList(list);
- }
- ...
- }
- private final static List<String> SUITS =
- Collections.unmodifiableList(
- Arrays.asList("Clubs", "Spades", "Hearts", "Diamonds")
- );
- public class MyClass {
- static private Properties propTable;
- static
- {
- try
- {
- propTable.load(new FileInputStream("/data/user.prop"));
- }
- catch (Exception e)
- {
- propTable.put("user", System.getProperty("user"));
- propTable.put("password", System.getProperty("password"));
- }
- }
- public class MyClass
- {
- public MyClass()
- {
- synchronized (MyClass.class)
- {
- if (propTable == null)
- {
- try
- {
- propTable.load(new FileInputStream("/data/user.prop"));
- }
- catch (Exception e)
- {
- propTable.put("user", System.getProperty("user"));
- propTable.put("password", System.getProperty("password"));
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment