As a rule, constructors with fewer arguments should call those with more.
public Pair() {}
public Pair(String car) { this(car, null); }
public Pair(Integer cdr) { this(null, cdr); }
public Pair(String car, Integer cdr) { this.car = car; this.cdr = cdr; }
More Related Contents:
- Operations on Strings
- Page scroll up or down in Selenium WebDriver (Selenium 2) using java
- What is “String args[]”? parameter in main method Java
- Android FTP Library [closed]
- proper hibernate annotation for byte[]
- How to deserialise a subclass in Firebase using getValue(Subclass.class)
- Null check chain vs catching NullPointerException
- calling java methods in javascript code [closed]
- Java Executors: how can I set task priority?
- How can you get an Android user’s email address?
- @PreUpdate and @Prepersist in hibernate/JPA (using session)
- Convert between LocalDate and sql.Date [duplicate]
- Favor composition over inheritance [duplicate]
- How do I calculate the elapsed time of an event in Java? [duplicate]
- How does `this` reference to an outer class escape through publishing inner class instance?
- Immutable objects are thread safe, but why?
- Is there away to generate Variables’ names dynamically in Java?
- Hibernate/JPA DB Schema Generation Best Practices
- How to do an HTTPS POST from Android?
- Does close ever throw an IOException?
- How can I reliably simulate touch events on Android without root (like Automate and Tasker)?
- Finding all objects that have a given property inside a collection [duplicate]
- BigDecimal adding wrong value
- Is it feasible to create a REST client with Flex?
- Cleanup after all junit tests
- How do you enforce foreign key constraints in SQLite through Java?
- What is the use of cloneable interface in java?
- Can I use SpringMvc and webflux together?
- How do you configure Embedded MongDB for integration testing in a Spring Boot application?
- What is the difference between += and =+?