Tag: Java

Java: Converting String to List

There are many other reasons for wanting to convert a String to a List. For example, the length of the String needs to be defined. Such a restriction does not…

Splitting strings in Java

Java’s split function packs a powerful punch. You can use it to split string on characters, symbols, substrings, a collection of symbols, or even regular expressions. public class SplitString {…

Java JAR, WAR, and EAR files

.ear, .war, and .jar files are simply files zipped using Java jar tool. Each file is created for a different purpose: .jar files Jar (Java Archive) files contain libraries, resources…

Java Linked List

The Internet is full of code examples on how you can create your own LinkedList class. Java provides and very easy to use class LinkedList. Following is an example on…

Java Constructors

Constructors are special kinds of methods which have the following properties: Constructors don’t have a return type Constructors have the same name as the class Constructors are used to initialize…

Java Inheritance Example

Inheritance is a fantastic feature which simplifies development and facilitates reuse of classes. A class can inherit properties and methods from another class. The inheriting class is called the subclass…

Java Arrays

Java arrays allow use to store multiple values of the same type. Array elements are accessible by their indices. 0 is the first index. arrayname.length gives the length of the…

Java recursion example

Recursion is when a function calls itself repeatedly. The classical example of recursion the factorial function. To create a recursive definition of this function, we need to define a recursive…

Introduction to Java Programming

Java is one of the most popular and widely used programming languages in the world. Lets begin with a simple program before getting into any details: Open your IDE or…