Home » Author Archives: Mary Zheng

Author Archives: Mary Zheng

Mary Zheng
Mary has graduated from Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She works as a senior Software Engineer in the telecommunications sector where she acts as a leader and works with others to design, implement, and monitor the software solution.

Breadth First Search Java Example

1. Introduction Breadth First Search (BFS) is a traversing or searching algorithm for a tree or graph data structure. BFS starts at the tree root, and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level. A tree is a nonlinear data structure which includes a root and ...

Read More »

Selection Sort Java Example

1. Introduction Selection sort Java ‘s simple algorithm, can divide the array into sorted and unsorted parts. Initially, the sorted part is empty; the unsorted part is the entire array. It starts by finding the smallest element from the unsorted part and swaps it with the left-most element of the unsorted part. Each finding reduces the unsorted part by one. ...

Read More »

Big O Notation Java Example

In this post, we feature a comprehensive Big O Notation Java Example. 1. Introduction Asymptotic notations are used to analyze an algorithm’s running time by identifying its behavior as the input size for the algorithm increases. There are six symbols used to characterize the relative growth rates of functions: SymbolSummary f = Θ(g) f grows at the same rate as ...

Read More »

String equalsIgnoreCase() Java Example

In this post, we feature a comprehensive article about the equalsignorecase Java ‘s String Method. 1. Introduction Java String class has provided the equalsIgnoreCase method to compare this String to another String by ignoring case since version 1. Here is the method’s signature: boolean equalsIgnoreCase​(String anotherString) The String class inherits the equals method from the Object class. It returns true if and only if the argument ...

Read More »

Java Math Operators and Math Class Tutorial

In this tutorial, I will demonstrate how to perform the mathematic operations via the build-in Math operators and the Java Math class. Table Of Contents 1. Introduction 2. Technologies Used 3. Maven Project 3.1 Dependency 3.2 Java Object 3.3 Java Object Has Equals Method 4. Arithmetic Operators 4.1 Addition Operator 4.2 Subtraction Operator 4.3 Increment Operator 4.4 Decrement Operator 4.5 ...

Read More »

Java Collections Tutorial

1. Introduction A collection is a group of objects and treated as a single unit. It is used to store, retrieve, and manipulate aggregate data. Java has provides a collection framework which contains interfaces, classes, and algorithms since version 1.2 and enhanced it over the time. Here are some enhancements: Major enhancement at version 5, including generic type.Added more interfaces ...

Read More »

Apache Commons BeanUtils Example

1. Introduction Apache Common BeanUtils is one of the most common Java library. The latest version at the time of writing is 1.9.3 and published at September 26, 2016. BeanUtils provides utility methods for populating JavaBeans properties. In this example, I will demonstrate the following methods: static Object cloneBean(Object bean) – Clones a bean even if the bean class does ...

Read More »

Java System.in System.out System.error Example

1. Introduction In this post, we feature a comprehensive article on Java System.in System.out System.error. Java has provided java.lang.System class since version 1.0. The System class contains a static System.in for the standard keyboard input, static System.out for the system console output, and static System.err for error output streams to the system console. Here are the definitions: static InputStream in - ...

Read More »

Printf Java Example

1. Introduction In this post, we feature a comprehensive printf Java Example. Java PrintStream class has provided the printf method to write a formatted string to the PrintStream object since version 5. Here are the method’s signatures: public PrintStream printf(Locale l, String format, Object... args) public PrintStream printf(String format, Object... args) l – a locale to apply during formattingformat – ...

Read More »

Java Interfaces Example

1. Introduction In this post, we feature a comprehensive article on Java Interfaces. Java interface is an abstract type that defines methods that classes must implement. It can contain constants, abstract method signatures, default methods along with an implementation body, static methods along with an implementation body, and nested types. Java Interface defines the “contracts” and represents the IS-A relationship. ...

Read More »