Core java
- 21 December
java.lang.StackOverflowError
In this article, we will discuss about the java.lang.StackOverflowError by looking different code examples and also how can we avoid them. More precisely, StackOverflowError is an error which Java doesn’t allow to catch, for instance ,stack running out of space, as it’s one of the most common runtime errors one can encounter, because it’s raising […]
- 19 December
Java BigInteger to BigDecimal
In this post, we will see how to convert BigInteger toBigDecimal in java. Using BigDecimal constructor You can simply use BigDecimal’s following constructor to convert BigInteger to BigDecimal. BigDecimal(BigInteger val) Here is the complete example to convert BigInteger to BigDecimal in java. [crayon-67424d4479d1c592883757/] When you run above program, you will get below output: BigDecimal bd: […]
- 11 December
Java wait seconds or delay Java program for few secs
In this post, we will see how to delay java program for few secs or wait for seconds for java program to proceed further. We need to delay a java programs in many situation where we want to wait for some other task to finish. There are multiple ways to delay execution of java program […]
- 10 October
Java program to print table of number
In this post we will see how to print table of number in java. It is good program to practice for loop in java. [crayon-67424d4479fc6600749472/] Output: Enter a Number : 8 Table of 8 is 8 * 1 = 8 8 * 2 = 16 8 * 3 = 24 8 * 4 = 32 […]
- 09 October
Java program to calculate grade of students
In this post, we will see how to calculate grade of students in java. Student’s grade is decided by average of marks.It is good program to practice execution of if statements in java. Here is simple program to calculate grade of students [crayon-67424d447a054528880894/] Output: Enter Marks for 5 Subjects : 50 60 70 80 90 […]
- 09 October
Find Vowels in a String
In this post, we will see how to find and count vowels in a string. Find Vowels in a String If any character in String satisfy below condition then it is vowel and we will add it to Hashset. character==’a’ || character==’A’ || character==’e’ || character==’E’ || character==’i’ || character==’I’ || character==’o’ || character==’O’ || […]
- 09 October
[Fixed] Reached end of file while parsing
In this post, we will see how to solve reached end of file while parsing in java. We generally get this error when we forgot to end code of block(class/method) with }. Let’s understand this with the help of example. [crayon-67424d447a20d502227023/] When you compile above java file, you will get below error. java:8: reached end […]
- 06 October
Java remove last character from string
Learn about how to remove last character from String in java using different ways.