Java

“Core Java” is Sun’s term, used to refer to Java SE, the standard edition and a set of related technologies, like the Java VM, CORBA, etc. This is mostly to differentiate from others like Java ME or Java EE. “Core Java” is Oracle’s definition and refers to subset of Java SE technologies.

The Core Java technologies and application programming interfaces (APIs) are the foundation of the Java Platform, Standard Edition (Java SE). They are used in all classes of Java programming, from desktop applications to Java EE applications.

Related Tags

Tutorials

Java String lastIndexOf()

Java String.lastIndexOf() returns the last index of the specified character or substring in this string, if the substring is not found then it returns -1.

Java String indexOf()

Learn to find the location of a character or substring in a given string and at what index position using the String.indexOf() with examples.

Java String hashCode()

Java String hashCode() returns the hashcode for the String. The hash value is used in hashing-based collections like HashMap, HashTable etc.

Java String endsWith()

Java String.endsWith() verifies if the given string ends with a specified substring or not. It does not accept NULL and regex patterns.

Java String compareToIgnoreCase()

Java String compareToIgnoreCase() example compares two strings lexicographically ignoring case. Learn how it differs from equalsIgnoreCase().

Java String compareTo()

Java String compareTo() method example. Learn to compare two strings lexicographically. We can consider this string comparison dictionary based comparison.

Java String equalsIgnoreCase()

Java String.equalsIgnoreCase() compares the current string with the specified string in a case-insensitive manner. Learn with examples.

Java String.equals()

Learn to compare the content of two String objects in a case-sensitive manner using the String.equals() API. For case-insensitive comparison, we can use the equalsIgnoreCase() method. Never use ‘==’ operator for checking the strings equality. It verifies the object references, not the content, which is undesirable in most cases. 1. String.equals() API …

Java String charAt()

Java String.charAt() returns the character at specified index argument in the string object or literal. The argument must be a valid index.

Java hashCode() and equals() Methods

Java hashCode() and equals() methods. Learn contract between hashCode and equals methods. How to correctly override both methods and best practices.

Convert Float to String in Java

Learn to convert float value to String using Float.toString() and String.valueOf() methods and format float to n decimal points.

Convert Exception StackTrace to String in Java

Java program to convert error stack trace to String. StackTrace to String conversion may be useful when you want to print stack trace in custom logs in files or store logs in database.

Java AES Encryption and Decryption: AES-256 Example

Java supports many secure encryption algorithms but some of them are too weak to be used in security-intensive applications. For example, the Data Encryption Standard (DES) encryption algorithm is considered highly insecure; messages encrypted using DES have been decrypted by brute force within a single day by machines such as …

Java StringJoiner

Java 8 StringJoiner joins strings with delimiter, prefix and suffix. Learn its usage with examples and differences with StringBuilder.

Check if Array Contains an Item in Java

Learn to check if an array contains an element. Also, learn to find the element’s index in the array. 1. Using Arrays Class To check if an element is in an array, we can use Arrays class to convert the array to ArrayList and use the contains() method to check …

Convert long to String in Java

Java example to convert long to String in two different ways using String.valueOf(long l) and Long.toString(long l) methods. Both are static methods.

Convert String to long in Java

Java examples of converting a String to a long type using Long.parseLong(String), Long.valueOf(String) and new Long(String) constructor.

Java Wrapper Classes, Autoboxing and Unboxing

Learn about Java wrapper classes, their usage, conversion between primitives and objects; and autoboxing and unboxing with examples. 1. Java Wrapper Classes In Java, we have 8 primitive data types. Java provides type wrappers, which are classes that encapsulate a primitive type within an Object. A wrapper class wraps (encloses) …

Java group by sort – multiple comparators example

Java examples to do SQL-style group by sort on list of objects. It involves using multiple comparators, each of which is capable of sorting on different field in model object. Table of Contents 1. Model class and multiple comparators 2. Comparator.thenComparing() 3. CompareToBuilder 4. ComparisonChain 5. Chained comparators 1. Model …

Java XPath – Find XML Nodes by Attribute Value

This Java tutorial demonstrates how to get matching nodes for an attribute value in an XML document using XPath. 1. XPath Expressions 1.1. Input XML File First look at the XML file which we will read and then fetch information from it, using xpath queries. 1.2. XPath Expressions Now see …

How to Unescape HTML in Java

Java examples unescapes an HTML string to a string containing the actual Unicode characters using StringEscapeUtils and a custom method.

Java Convert Properties File to XML File

Java example to create XML file from Properties object or any existing .properties file. To convert an XML file to .properties file, follow the steps given in linked tutorial. 1. Create XML File from Properties File To convert the properties file into an XML file, the best way is to …

Java Collections sort()

Learn to use Collections.sort() method to sort a list of objects using some examples. By default, the sort() method sorts a given list into ascending order (or natural order). We can use Collections.reverseOrder() method, which returns a Comparator, for reverse sorting. 1. Sorting in Natural Order and Reverse Order 1.1. …

Sorting Arrays in Java

Learn to sort a Java array of primitives, strings and custom objects in multiple ways with the help of Comparable and Comparator interfaces, Arrays.sort() and Stream.sorted() APIs. We will learn to sort arrays in natural ordering, reverse ordering and any other custom ordering as well. 1. Basics of Array Sorting …

How to Create Subarray in Java

Java example to create subarray from array. Learn to use Java 8 Arrays.copyOfRange() method along with converting the subarray to list object.

Converting between Date to LocalDate

Learn to convert from java.time.LocalDate to java.util.Date and vice-versa using the easy-to-understand Java examples. 1. Convert Date to LocalDate The Date.getTime() method returns the epoch milliseconds i.e. the number of milliseconds since January 1, 1970, 00:00:00 GMT. To get the LocalDate, we need to first set the zone offset information …

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.