Java Code to Print Hello World

In this article we are going to write ‘Hello World’ program in java. This is a beginner level program in Java. HelloWorld.java package gangforcode;public class HelloWorld { public static void main(String[] args) { System.out.println(“Hello World!!”); }} Hello World Java Output – This is the simplest java code with the main class and a single print … Read more

Valid Parentheses Program in Java

in this article we are going to Write the program of checking valid Parentheses in java Valid Parentheses Solution validParentheses.java package gangforcode; import java.util.Stack; public class validParentheses { public static Boolean validParentheseCheck(String x) { if(x.length()<=1){ return false; } Stack<Character> stk= new Stack<>(); for(int i=0;i<x.length();i++){ if(x.charAt(i)=='[‘ || x.charAt(i)=='{‘ || x.charAt(i)=='(‘){ stk.push(x.charAt(i)); } if(stk.isEmpty()) return false; if(!stk.isEmpty()) … Read more

Spring Boot and React Js Full Stack Project

This article will create a full-stack project using spring boot and React Js. We will create different microservices for the backend using spring boot, MySQL, and MongoDB. after that, we will test them with the postman. After that, we will create the front end by using React Js. HTML, CSS, and connect it with the … Read more

User Authentication Service Using Spring Boot

In this article, we are going to create a user authentication Service for our full-stack project, for this authentication service we use spring boot and MySQL Create a Spring Boot Project Let’s start with creating spring boot project . Go to https://start.spring.io/ and create a spring boot maven project with data JPA, mqsql, lambok and … Read more

Multidimensional Array in Java

Multidimensional Array An array with more than one dimension is known as a multidimensional array. A multidimensional array is an array of arrays. for example, a 2D array is a collection of the 1D array. A 3D array is a collection of 2D arrays put together with a 1D array. 2D Array Declaration 2D arrays … Read more

MongoDB auto-generated id with spring boot

In this project we are going to see how we can auto generate id in mongo db with spring boot. we are going to create a simple spring boot project with mongodb. Dependencies add the following dependencies in your spring boot application’s pom.xml Project structure let’s create our model class. inside this class make your … Read more

Data Hiding in Java

Data hiding is a technique used in objected oriented programming to hide data members of the class. hiding data members means no one from outside can directly access data members or modified data members. For accessing data external person needs to go through authentication or validation. data hiding increases the data security. for example, Instagram … Read more

find one extra character in string

In this article, we are going to find one extra character in given two strings. Problem:- we have two strings s1 and s2 of length n and n+1. we need to find that one extra character in string s2 that is not present in string s1. Java code to find one extra character in given … Read more

Reverse a String

In this article, we are going to discuss how we can reverse a string using code. for this tutorial, we are going to use java for reversing a string. in java, we can reverse a string in many ways by using the inbuilt function, by converting the string to a char array, adding each character … Read more

String in Java

In this article, we are going to learn about strings in java. A string is a sequence of characters, in java string is an object which represents a sequence of characters. An array of character works the same as a string. strings are immutable in java. In java every character is stored in 16-bits. char[] … Read more

Quick Sort

In this article we will discus about quick sort which is one of the sorting algorithm. The Quick sort algorithm uses divide and conquer strategy. First divide the unsorted array into multiple sub arrays and then recursively sort the sub-arrays and combine them to obtain a solution. The division of sub-arrays are based on pivot … Read more

Data Types in Java

In this article we are going to discuss about data types in java. data type is set of possible values and set of allowed operation on it. it specify different sizes and vales that can be stored in a variable. There are two type of data types in java:- Primitive data types in java:- In … Read more

identifiers in java

In this article, we are going to discuss about identifiers. Identifiers are the names given to variables, methods/functions, classes, interfaces. For example:- int number=1231; String str=”identifiers in java”; In the above example “number” and “str” are the identifiers. Rules for identifiers in java:- There are some rules for declaring identifiers in java. if identifiers are … Read more

keywords in java

In this article, we are going to discuss about keywords in java. Keywords are predefine words in programing language. we cannot use these keywords as variable names because they are already predefined. Java keywords:- These are some java keywords written below. You cannot use these keywords as a identifiers in your programs. goto keyword is … Read more

what is java ?

In this article, we are going to discuss the advantages of java what is java? uses of java advantage of java disadvantage of java etc. History of java:- java is one of the famous programming languages. it was developed by “James Gosling” in 1995 at sun microsystems. The development of java starts in 1991. This … Read more

Digits after decimal

In this article, we are going to find digits after decimals in given number. for this, we will write a java code. Example:- if n=145.258, then the output will be 258. Steps:- Java code to find digits after decimal numbers:- Output:- The same logic can be used to find digits after decimals in other programming … Read more

binary to decimal

In this article, we are going to see how we can convert binary to decimal. We also write java code to convert binary to decimal. Binary to Decimal conversion:- Steps:- Java code to convert binary to decimal:- Output:- The same logic can be used to convert binary to decimal in other programing languages like C, … Read more

decimal to binary

In this article we are going to see how we can convert decimal to binary. We also write java code to convert decimal to binary. Decimal to Binary conversion:- For conversion of Decimal to Binary continuously divide the decimal number by 2 until decimal number become 0. and add every reminder after division at the … Read more

Merge Sort

In this article we will learn about merge sort. Merge sort is one of the sorting technique that follows divide and conquer strategy to sort the elements. In merge sort algorithm we split the entire array into two equal parts, the sub- arrays are again continuously divided into parts until the array can not be … Read more

string palindrome in java

In this article, we are going to discuss about palindrome string and write a code in java to check whether a given string is palindrome or not. Palindrome String:- A palindrome string is a string that remains the same after reversing the string for example-“abc”, this is not a palindrome string because after reversing the … Read more