What exactly is encapsulation in terms of Java object oriented programming? If you look up encapsulation in the dictionary it defines it as to enclose or to be enclosed in or as if in a capsule. Java Encapsulation is
Arrays in Java programming are very useful when used the right way. The Java String Array is a container that holds a list of Strings. The code snippets below provide examples what can be done with String Arrays. There
If your new to Java programming or haven’t had a chance to understand inheritance, let’s get that out of the way now. Inheritance in Java is allows you to build code on top of code that already exists. If
The sample Java code below will search for the number of occurrences of a given String within another String. While this could have been done using the standard Java APIs, I really like the Apache Commons Lang API because
I make use of threads and thread pools in my Java applications and I like to see what threads are currently running and what they are doing. I created this small code snippet that I call periodically using the
The Java switch statement is useful when you need to make a decision in a program with multiple possibilities. While the same principle can be done with a series of if-else statements, the switch statement is easier to read.
When you create a Java thread pool your not stuck with the default naming of pool-1-thread-1. When it comes time to diagnose a problem with your Java code, it is much better to be able to give the thread
When you have a list of similar tasks to perform, creating a Java Thread Pool is a good option. Start off my creating a Runnable that takes care of the needed task. Create a thread pool with the number
The Java System class comes with some very useful methods when it comes to System Properties. The Java platform uses a Properties object to maintain its own configuration. The Properties object describes the configuration of the current working environment.