Interview
01 AugustCount Factorial Trailing Zeroes in java
In this tutorial, we will see how to count trailing zeros in factorial of a number in java. Problem Count number of zeros in factorial of number in java. For example: Factorial of 6 is 720, so a number of trailing zeros is 1. Factorial of 14 is 87 178 291 200, so a number […]
14 JuneLongest Substring Without Repeating Characters
If you want to practice data structure and algorithm programs, you can go through Java coding interview questions. In this tutorial, we will see Find Longest Substring Without Repeating Characters in java. Problem We need to find Longest Substring Without Repeating Characters Solution Brute force solution Find all the substring and check the Longest Substring Without […]
24 MayCollections in java
In this tutorial, we will see about Collections in java. Collection framework is core part of java programming language. It is used in almost all the applications. Collections framework provides a way to store and retrieve the collection of elements. This framework has many interfaces and classes which makes programmer life easy. Let’s go through […]
22 May100+ Core Java Interview Questions and Answers for 2022
Introduction In this post we will look into the most commonly asked Interview questions related to Java. We will take a look at the most common topics in Java for interviews and provide the answer to the questions in detail with examples to help you ace your next interview. We recommend following this post step […]
20 MayJava 8 tutorial
In this post, we will see about Java 8 tutorial. I have written a lot of tutorials on Java 8. This is index post for all Java 8 posts. [toc] Java 8 has lots of new features which will change the way you do programming. Here is a list of features you need to know […]
20 JanuaryJava program to count number of words in sentence
In this tutorial, we will see a simple java program to count number of words in sentence. import java.util.Scanner; public class StringOperator { public static int countWordsinStr(String str){ int count = 1; for(int i=0; i<=str.length()-1; i++){ if(str.charAt(i) == ' ' && str.charAt(i+1)!=' '){ count++; } } return count; } public static void main(String args[]){ String […]
20 JanuaryJava program to find largest number in array
In this tutorial, Java program to find the largest number in array. Here is simple algorithm to find larget element in the array. Initialize lrg with arr[0] i.e. first element in the array. If current element is greater than lrg, then set lrg to current element. import java.util.Scanner; public class Finder { public static void […]
20 JanuaryJava program to find minimum value in array
In this tutorial, Java program to find minimum value in an array. Here is simple algorithm to find minimum value in the array. Initialize sml with arr[0] i.e. first element in the array. If current element is less than sml, then set sml to current element. import java.util.Scanner; public class Finder { public static void […]
20 JanuaryJava program to print Diamond pattern
In this tutorial, we will see java program to print diamond pattern. import java.util.Scanner; public class DiamondPattPrinter { public static void main(String args[]) { int cnt, c, k, space=1; Scanner scan = new Scanner(System.in); System.out.print("Enter count/number of Rows for Diamond pattern : "); cnt = scan.nextInt(); space = cnt-1; for(k=1; k<=cnt; k++){ for(c=1; c<=space; c++){ […]