Programming

HomeProgramming
 
 
- Advertisement -
- Advertisement -
- Advertisement -

JAVA

HIBERNATE

VBSCRIPT

MAVEN

PROGRAMMING POSTS

Format Decimal Numbers Using Locale

If you want to create a DecimalFormat instance for a specific Locale, create a NumberFormat and cast it to a DecimalFormat. The java.text.DecimalFormat class is used to format numbers using a user specified formatting. This concrete subclass of NumberFormat, allows formatting decimal numbers via predefined patterns specified as String ....

Format Decimal Numbers Using Pattern

The java.text.DecimalFormat class is used to format numbers using a user specified formatting. This concrete subclass of NumberFormat, allows formatting decimal numbers via predefined patterns specified as String. It has a variety of features designed to make it possible to parse and format numbers in any locale The following example...

Java Tutorial #7 Part 1 – Classes & Objects

Classes are a very important concept in Java. Java code always needs to be written in a class. In this article, we will be taking a very close look at classes and understanding their syntax and semantics. Classes and objects A class defines a new data type. Once defined, this new...

Java Tutorial #6 – Jump Statements

Introduction The break statement is used to stop further execution. It can be used either in a loop or within a switch statement. Break Statement The break statement is used to stop further execution. It can be used either in a loop or within a switch statement. Break in a loop When the break...
- Advertisement -

Convert String to java.time.LocalDate with Formatter

The LocalDate class has an overloaded parse() method. In addition to the String Date, it accepts a DateTimeFormatter instance that specifies the format of the input date. So, this can be used in case the String date is not in the yyyy-MM-dd format. The following code demonstrates this: The following code demonstrates...

Convert String to java.time.LocalDate without Formatter

The LocalDate class has a parse method. You can use this to convert a String to a LocalDate. So, this code simply invokes the parse method with the String date object. It prints the following output: 2015-06-12. The following code demonstrates this: cd2973313a135357d0890b0ba8152680 The LocalDate.parse() method requires the String date to...

Java Tutorial #5 – Loop Statements

Iteration statements are used to repeat a particular block of code until a certain condition is true. In this article, we will be taking a look at Java’s iteration statements. While Statement The while statement repeats a block of code as long as a condition is true. Syntax A while statement has the...

Convert String to Date Using java.util.Calendar

The java.util.Calendar class also encapsulates a date. The Calendar class has some more features than the java.util.Date class. It provides the ability to extract the day, month, year, and other fields corresponding to the date that the Calendar represents. So, sometimes, you may need to convert a String date...
- Advertisement -

Convert String to Date Using SimpleDateFormat Class

Sometimes, you may need to convert a String to a java.util.Date object. For this, you need to use the SimpleDateFormat class. You need to specify the format in which the String date is present and invoke the parse method. The following code demonstrates how this can be done: 9511d34805f97b537363b6106339b495 This code...

Java Tutorial #4 – Control Statements

Introduction Control statements are used to change the flow of execution based on changes to certain variables in the code. One of the types of control statements are the selection statements or decision statements. These should be used when you want to check some condition and take a decision based...

Java Tutorial #3 – Java Arrays

Table of Contents One Dimensional Array Declaring Array Allocting Memory to Array Accessing Array Elements Initializing Array Length of Array Multi Dimensional Array Creating 3 Dimensional Array Introduction Arrays are used to store a group of values of the same data type. So a single variable can be used to refer to...

CODE GISTS

Concatenate Strings Using StringBuilder.append()

In addition to String, Java has the java.lang.StringBuffer and java.lang.StringBuilder classes. These can also be used to concatenate Strings. The advantage of these...

Concatenate Strings Using String.join() for Collections

There is an overloaded version of the String.join method that accepts as parameter an Iterable implementation. Since all Collection classes implement the Iterable interface,...

How To Load XML File into DOM Using MSXML

Microsoft XML Core Services (MSXML) provides two methods for loading XML documents into the Document Object Model (DOM) and one method and one property...

How To Customize GitBash For Windows

By default the GitBash prompt settings / configuration come from shell script called 'git-prompt.sh'. This is usually hosted inside 'profile.d' directory inside the GitBash...

POPULAR | TAGS

TOP | CATEGORIES