Monday, 26 October 2015

System.setOut API in Java

System.out.println, by default, logs a message to console if the process has a reference to console window. For subprocesses, by default, there is no console attached. By making use of System.setOut we can redirect the output to a file or some other stream.

Code to redirect the output stream to a file.

File out = new File("/tmp/out.txt");
PrintStream outputStream = new PrintStream(out);
System.setOut(outputStream);

Now,
System.out.println("Hello world!");

This will result in Hello world! getting printed in /tmp/out.txt file.

Similarly, System.setIn and System.setErr APIs are also available and can be used wherever needed.

Wednesday, 21 October 2015

General Software Development blogs - Part 1

 
The ByteBaker - PhD student at Cornell University.

Coding Horror - programming and human factors


Mark Needham - Thoughs on Software Development


Misko Hevery - The Testability Explorer Blog




The Database Programmer - All things related to database applications, both Desktop and Web


Monday, 19 October 2015

JVM related blogs


NoBlogDefFound - Tomasz Nurkiewicz around Java and code quality 

Vanilla #Java - Understanding how Core Java really works can help you write simpler, faster applications. 

Inspired by Actual Events - Dustin's Software Development Cogitations and Speculations 

The Takipi Blog - Server Debugging Made Easy 

ZeroTurnAround RebelLabs 

Java, SQL and jOOQ - Best Practices and Lessons Learned from Writing Awesome Java and SQL Code. Get some hands-on insight on what's behind developing jOOQ. 

Plumbr - Java Performance Tuning blog 

Vlad Mihalcea's Blog - Teaching is my way of learning 

Nicolas Fränkel blog - A Java Geek 

Petri Kainulainen - Do you want to be a better software developer? 

Stephen Colebourne's blog  - Thoughts and Musings on the world of Java and beyond 

How to do it in Java - Java Tutorials and Best Practices 

JaxEnter 

JavaSpecialists

Adam Bien's Weblog  

Java Concurrency - Jeremy Manson's blog, which goes into great detail either about concurrency in Java, or anything else that the author happens to feel is interesting or relevant to the target audience.