How to convert String to int in Java

  • 23 November 2020
  • ADM

How to convert String to int in Java using Integer.parseInt and Integer.valueOf methods. Simple example provided.


How to read XML file in Java using DOM

  • 12 July 2016
  • ADM

How to read XML file in Java using DOM. 2 methods: one reading each element by the name and second parsing the entire DOMobject.


How to create XML file in Java using DOM

  • 11 July 2016
  • ADM

How to create XML file in Java using DOM. Simple example with pretty printing to output the content to console or to a file.


How to read and write files in Java

  • 17 June 2016
  • ADM

How to read and write files in Java using BufferedReader and BufferedWriter. The example highlights the classic resource release and try-with-resource approach.


Java Exceptions handling

  • 16 June 2016
  • ADM

How to handle exceptions in Java. Checked and unchecked exceptions example using custom implementation.


Split URL into components using regex

  • 23 May 2016
  • ADM

Split URL into components (protocol, domain, port and uri) using regex in Java. Simple and tested example.