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.

Java 11 New Features Tutorial

In this tutorial, I will talk about the JDK 11 product changes. Then I will dive into several API changes with Java examples. Finally I will show the new Single-File Launcher, which executes a Java source file without going through the compile processing. Table Of Contents 1. Introduction 2. Install JDK11 3. Technologies Used 4. Change at java.lang.String 5. Change ...

Read More »

Java String charAt() Method with Example

1. Introduction The java.lang.CharSequence interface provides read-only access to many different kinds of char sequence. It has provided a charAt method since version 1.4 to return the character value at the specified index. java.lang.String class implements java.lang.CharSequence. The string indexes start from zero to the string’s length() minus one. Here is the method syntax: char charAt(int index) Parameters: index – ...

Read More »

Java String contains() method with Example

1. Introduction The java.lang.String class represents character strings. It has provided a contains method since version 5 to return true if and only if this string contains the specified sequence of char values. Here is the method syntax: boolean contains(CharSequence s) A CharSequence interface represents a readable sequence of char values. It has five implementation classes: java.nio.CharBuffer, javax.swing.text.Segment, java.lang.String, java.lang.StringBuffer, ...

Read More »

Java String trim() method with Example

1. Introduction The java.lang.String class represents character strings. It provides a trim() method since version 1.4 to return a new string object whose value is the copy of the original string without any leading or trailing white-space. Note: a white-space is when the ASCII code of the character is less than or equal to the space character, which is \u0020. ...

Read More »

Apache Maven Eclipse Integration Tutorial

Apache Maven Eclipse Integration aims to ease developers to update pom.xml in the Eclipse IDE. In this tutorial, I will demonstrate how to create, build, and modify a Maven project in the Eclipse IDE. Table Of Contents 1. Introduction 2. Install Eclipse 3. Install Maven 3.1. Settings.xml 4. Install M2Eclipse 4.1. Check If M2E is Installed or Not 4.2 Configure ...

Read More »

Apache Maven Eclipse Project Creation Using Archetype Example

1. Introduction Eclipse is a Java Integrated Development Environment (IDE). Eclipse has had Maven Integration for Eclipse since version Luna. Maven Archetype is a Maven project template plug-in. It enables developers to create a new maven project consistently and quickly. Eclipse IDE comes with nine most commonly used archetypes. Maven hosts about over 600 archetype in the remote catalog. I ...

Read More »

Spring @Scheduled vs Quartz Scheduler Example

1. Introduction Spring is a Java application framework that provides many useful services for building applications. It provides two annotations to enable scheduling tasks:             @EnableScheduling – to enable Spring’s scheduled task execution capability. It’s used on a class with @Configuration annotation.@Scheduled – to mark a method to be scheduled. The annotated method must have no ...

Read More »

Java 8 Functional Programming Tutorial

Java 8 supports functional programming via the lambda expression and Stream API. In this tutorial, I will demonstrate how Java 8 supports functional programming via common pre-defined functional interfaces, Collections, and Stream API.                 Table Of Contents 1. Introduction 2. Technologies Used 2.1 Maven Project 3. Java 8 Predefined Functional Interfaces 3.1 Function ...

Read More »

Java 8 Format LocalDateTime Example

1. Introduction Java 8 Date-time API provides a java.time.LocalDateTime class which is an immutable date-time object and often is viewed as a year-month-day-hour-minute-second format. It contains a java.time.format package to handle the formatting of dates and times. This package includes three classes: DateTimeFormatter – to print and parse date-time objects. It provides common formatting constants as well as a string ...

Read More »

Java 8 Compare Dates Example

1. Introduction Java 8 added a new set of packages to provide a comprehensive date-time model. Java 8 Date-Time API is a JSR-310 implementation.                   There are several interfaces: ChronoLocalDate, ChronoLocalDateTime, ChronoZonedDateTime in java.time.chrono packages. They all have isBefore, isAfter, isEquals, and compareTo methods to compare two dates. Java 8 date classes: ...

Read More »