Core Java

Java beginners Guide

First steps in Java programming.

For a introduction tutorial in Java please see the official help from SUN here
where, except of the core language, several technologies and APIs are
introduced. We propose to begin by reading the trails covering the
basics and continue with the rest of the tutorials.

We propose to :

  • Keep the code straightforward and easy to read
  • Split functionality in logical components (classes) that interconnect if necessary
  • Try to comply with code re-usability design patterns, where common functionality is implemented in a public accessed methods
  • Document your code, using Javadoc comments and/or simple comments
  • Use a logging framework (Apache log4j is widely deployed and used) to produce logs
  • Use a testing framework (JUnit is widely deployed and used) to test your code
  • If you code involves String manipulation (splitting, adding, scanning
    characters etc), use the StringBuilder class rather than the String
    class, the StringBuilder implementation is much faster
  • If your code involves lists or maps, the ArrayList and HashMap are the fastest
    implementations, nevertheless if you are using the contains(Object)
    method on a collection, then the HashSet is the fastest implementation
    introducing a O(1) cost.
  • Java 5 and later versions include a management console (jconsole). You can use it to monitor your application
  • If your code involves pattern matching, prefer to use the Pattern and
    Matcher classes, rather than the Pattern.matches(regex, input)
    convenience method. Compile the pattern and use the Matcher.find()
    method as described below, especially if you reuse the same pattern
    where you should compile the pattern only once.

Preferred method for patter matching:

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

  public static void main(String args[]) throws Exception {

    Pattern p = Pattern.compile("Java \\d");
    String candidate = "this is a Java test";
    Matcher m = p.matcher(candidate);

    System.out.println("result=" + m.find());

Want to know how to develop your skillset to become a Java Rockstar?

Join our newsletter to start rocking!

To get you started we give you our best selling eBooks for FREE!


1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design


and many more ....


Receive Java & Developer job alerts in your Area

I have read and agree to the terms & conditions


Byron Kiourtzoglou

Byron is a master software engineer working in the IT and Telecom domains. He is an applications developer in a wide variety of applications/services. He is currently acting as the team leader and technical architect for a proprietary service creation and integration platform for both the IT and Telecom industries in addition to a in-house big data real-time analytics solution. He is always fascinated by SOA, middleware services and mobile development. Byron is co-founder and Executive Editor at Java Code Geeks.
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
SoftMAS | Desarrollo de software

Hi, great post, I take it as a guide for my blog, Thanks a lot!!.

8 years ago

SO NIcely Written for .. New Beginners .. But To understand these points one has to be a coder first !!

Back to top button