How To Delete A Git Branch (Local or Remote)
In this article, we will see how to delete a GIT branch both locally or remotely.
Short Snippet
Delete the local branch, if you finished working on a branch, and merged
git branch -d <the-local-branch>
Delete the local branch without checking the merged status
git branch -D <the-local-branch>
Delete remote branch (Git v1.7.0 an...
Java: Check If Array Contains Value or Element
In this quick beginner-friendly tutorial, we will see how to check if an array contains a value or an element using the Java Programming Language.
We can check if an element or value is present or not in two types of arrays,
For String Array
For Primitive Array
1. For String Array.
For String Array, we can check if an array contains a p...
How To Get Current Date Time In Java?
We need to use Date and Time in day-to-day programming. In this article, we will see how to get the current date and time in Java.
Introduction
There are many ways to get the current date and time in Java. One of them is, using Legacy date and calendar API, and another one is using Java 8 date and time API.
Java Date API (java.util.Date) (...
How To Get Current Timestamp In Java?
In this article, we will see how to get the current timestamp in Java.
To get the current timestamp in Java, we can use java.time.Instant from Java 8 and java.sql.Timestamp till Java 7.
We check both java.time.Instant and java.sql.Timestamp one by one.
1. Using java.time.Instant ( for Java 8)
As per the javadoc,
This class models a sing...
Groovy: How To Determine The Datatype Of An Object?
In this quick tutorial, we will see how we can determine the datatype of an object in Groovy.
Introduction
When you are writing a Groovy code, sometimes you need to check the datatype of an object. Also, not following the proper naming convention may lead to object datatype confusion.
We will see the best way to check the datatype of an obje...
How To Convert double To int In Java?
In this article, we will see, how to convert a double value to an integer value in Java programming language.
Let’s say, you have a double primitive value (ex 82.14), but you need an int value (ex. 82) for further operations. So, let’s see how to convert double to int in Java.
There are three ways you can convert double to int. I have listed t...
How To Convert An Integer To String In Java
In this article you are going to learn how can you convert an integer to a String.
There are multiple ways we can convert an int to string in java. let’s check what are they.
String.ValueOf() method
Integer.toString() method
String.format() method
1. String.valueOf() method
String.valueOf() method returns the string representation of...
How To Parse JSON In Java?
In this article, we will see, how to parse JSON in Java. We will be using the JSON Libraries like JSON-java, GSON and json-simple
Introduction
JSON stands for JavaScript Object Notation. It is easy to use and lightweight open standard file format for storing and transporting data.
As per the json.org,
It is easy for humans to read and writ...
99 post articles, 12 pages.