-
Recent Posts
- Follow softwarecave on WordPress.com
Archives
- December 2021 (1)
- October 2021 (2)
- April 2018 (1)
- March 2018 (3)
- February 2018 (1)
- February 2017 (4)
- December 2014 (3)
- November 2014 (2)
- August 2014 (1)
- July 2014 (2)
- June 2014 (2)
- May 2014 (2)
- April 2014 (5)
- March 2014 (9)
- February 2014 (11)
- January 2014 (6)
- September 2011 (1)
Categories
Monthly Archives: October 2021
Unexpected NullPointerException (NPE) in ternary conditional operator in Java
Sometimes I come across Java code that unexpectedly throws NullPointerException in ternary operator. It is especially surprising if this particular line of code seems very simple like: or even: At first, it might look like the condition is not met … Continue reading
Create text file in Java with contents
Creating a text file (with given contents) is pretty straightforward task in Java. Recent Java versions and popular libraries like Apache Commons or Guava make this task even easier than it used to be. Below are some ways how to … Continue reading