Showing posts from February, 2019

Java Program to Rethrowing an Exception

An exception can be rethrown in a catch block. This activity will make the exception be passed to the calling technique. On the off chance that the rethrow activity happens in the fundamental strategy, at that point the exception is passed to the JVM…

Java Program To Implement Throw Statement

The throw keyword in Java is utilized to explicitly throw an exception from a strategy or any block of code. We can throw either checked or unchecked exception. The throw keyword is mostly used to throw custom exceptions.  The flow of execution of …

C++ program to perform Operator Increment

In programming (Java, C, C++, PHP etc. ), increment  ++  operator increases the value of a variable by 1 Suppose, if x = 6 then, ++a; //x becomes 7 a++; //x becomes 8 --a; //x becomes 7 a--; //x becomes 6 Opera…

Java Program To Perform Multiple Catch Statement

A try block can be trailed by at least one catch blocks. Each catch block must contain an alternate exception handler. In this way, on the off chance that you need to perform diverse errands at the event of various exceptions, use java multi-catch bl…

Java Program To Implement Divide By Zero Exception

Java won't throw an exception in the event that you partition by float zero. It will identify a run-time error just on the off chance that you separate by integer zero, not double zero. On the off chance that you separate by 0.0, the outcome will…

Java Program To Implement a Calculator

In this Program we are making a basic calculator that performs addition, subtraction, multiplication and division dependent on the user input. The program takes the estimation of both the numbers (entered by user) and after that user is approached to…

Java Program To Implement Enhanced For Loop

Enhanced For Loop in Java I n Java, there is another form of for loop (notwithstanding standard for loop) to work with arrays and collection, the enhanced for loop.  On the off chance that you are working with arrays and collections, you can uti…

Java Program To Find Minimum among 3 Numbers

Here we have a simple java prpgram to find a minimum among 3 numbers where input is taken from the user and compare all the integers and show the minimum among all. Java Program To Find Minimum of 3 numbers import java.util.Scanner; class Minimum…

Java Program To Check Body Mass Index

Java Program To Check Body Mass Index import java.util.Scanner; class BMI {    public static void main(String args[])    { Scanner sc = new Scanner(System.in); float weight; float height; float bmi; System.out.print(&…

Java Program To Find Perimeter of Triangle

This is a Java Program to Find the Perimeter of a Triangle.  formula to calculate perimeter of triangle:  Perimeter of triangle=(t1+t2+t3 )  Enter the three sides of the triangle as inputs. Calculate the perimeter by utilizing formula and get t…

Java program to check if an integer is divisible or not

In this example we will show user how to write  a java programming language to check whether entered integer is multiple or not using if and else statement. For Example, we have initialised two variables such as a=96 and b=24. If 96%24 is equal to z…

Load More
That is All