Home » Core Java (page 2)

Core Java

SQL Primary Key Example

Welcome readers, in this tutorial, we will understand the SQL Primary Key column that uniquely identifies a tuple in the database table. 1. Introduction SQL Primary Key is a column or multiple columns that uniquely identify a tuple in the database table. It contains unique values but cannot have null or duplicate It consists of multiple columns known as a ...

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 »

Java Date Format Example

In this article, we will check the options available on Java Date Format. 1. Introduction Java has multiple packages providing various utility functions to make developer job easier. One such is the java.text package which includes utility classes for parsing and formatting numbers and dates, along with utility classes for building other kinds of parsers. The java.text.DateFormatclass and its concrete ...

Read More »

Java Ternary Operator Example

1. Introduction The word “ternary“, in mathematical terms, is an operation that takes 3 variables and, when combined, produces a single output. In Java, as in other languages such as JavaScript or Python, the ternary, or conditional operator, is the only operator that takes 3 operands and produces a value. In this example we will examine the syntax and the ...

Read More »

Java Binary Search Tree Example

1. Introduction A binary tree is a recursive data structure where each node can have at most two children. A binary search tree (BST) is a special type of binary tree which has the following properties: The left sub-tree of a node contains the nodes with the key’s value lesser than itself.The right sub-tree of a node contains the nodes ...

Read More »

Java Round Number to N Decimal Places Example

In this example, we are going to show how we can round a decimal number in Java. Before going in details let us brief you about what exactly is the rounding a number means. 1. What is rounded Number A rounded number has about the same value as the original number we started with. It is less exact than the ...

Read More »

Java Math.pow Example

In this article, we examine the Java Math.pow method and we provide some examples of its use. 1. Introduction The java.lang package provides classes and interfaces that are central to the Java programming language. The Math class from the java.lang package contains static methods for performing many common math operations. These include exponential, logarithm, square root, and trigonometric functions. One ...

Read More »

Gradle Grails Example

1. Introduction This is an in-depth article on Gradle Grails projects. Gradle is a build management system which is open-sourced. The scripts are developed using Groovy or Kotlin DSL for managing builds. Grails is an opensource framework for developing full stack applications. 2. Gradle Grails 2.1 Prerequisites Java 8 is required on the linux, windows or mac operating system. Gradle ...

Read More »

Java 12 String Methods Example

In this article, we will discuss the new methods of the String class introduced in Java SE 12. 1. Introduction The latest Java release (Java SE 12) arrives on the heels of Java SE 11, due to the twice-annual release schedule. It is more akin to a point release than a major release, with only minor changes from the previous ...

Read More »