Category Archives: java

Example of exception handling with try catch in java

Example of exception handling with try catch in java. Exceptions are the undefined conditions that occur and are to be handled. Exceptions are called as run time exception. You can read the following article to know more about exception : What are exception and why exceptions are to handle and also difference between throw and throws … Continue reading Example of exception handling with try catch in java

Difference between throw and throws keyword with example in Java

Difference between throw and throws keyword with example in Java. Throw and Throws are the two keyword used in java for exception handling. To know this keyword, we should know about exception and why to handle exception, and how we can handle exception in java. Here is the definition of throw and throws : Difference between … Continue reading Difference between throw and throws keyword with example in Java

Pass command line arguments in NetBeans IDE

Pass command line arguments in NetBeans IDE. Netbeans IDE is an open source designed to develop java application, and also supports other languages like php, C++ and html. Command line argument is used for a program, before it runs, as it is passed to its invoking function. A very common use of command line arguments, when … Continue reading Pass command line arguments in NetBeans IDE

Java program to search string in a line

Java program to search string in a line. This program makes use of Scanner class findInLine(string) function making it very simple job to search some set of characters or string in a given string. You can also see the following program which uses Scanner class to take input and for tokenizing: Java program to take input and … Continue reading Java program to search string in a line

Java program for Arithmetic Progression (A.P)

Java program for Arithmetic Progression . Arithmetic Progression(AP) is also known as Arithmetic sequence or series. It a series of number such that the difference between the consecutive terms is constant. For example : 3, 8, 13, 18, 23, 28, 33…. and so on. Here the constant difference between consecutive terms is . You can create Arithmetic … Continue reading Java program for Arithmetic Progression (A.P)

Java program to find Current year month date

This program just demonstrates how to make use Calendar class, and find Current year, month and date. While you can also see java program to display current time with calendar instance printing and values. Java program to find Current year month date. //Calendar class is used with various inbuilt fields to identify the current year,current … Continue reading Java program to find Current year month date

Java program for Calendar class to display current date time

Program makes use of Calendar class and Date class. Calendar class can be found in java.util package. You can also find java program that only displays current year, month and date. While this program with current time prints details of instance of calendar. Here is the program. Java program for Calendar class to display current date … Continue reading Java program for Calendar class to display current date time

Dynamically Fetch data from Mysql to (drop down) select option in Jsp

Dynamically Fetch data from Mysql to (drop down) select option in Jsp. This post illustrates, to fetch the data from the mysql database and display in select option element in Jsp. You should know the following post before going through this post i.e : How to Connect Mysql database to jsp. How to create database … Continue reading Dynamically Fetch data from Mysql to (drop down) select option in Jsp

Java program that declares some integer and find largest and smallest

Java program that declares some integer and find largest and smallest. An application that declares some integers, determines and prints the largest and smallest in the group. This program takes in input from key board with the help of Scanner class. MIN and MAX are constant values integers taking the maximum range and minimum range of … Continue reading Java program that declares some integer and find largest and smallest

Java program to find divisibility of number

Java program to find divisibility of number. This java program finds that whether the number or dividend is divisible by divisor or not. If remainder is zero then the number is divisible. For finding the remainder, ‘%’ (modulus operator) is used. Here is the program. Java program to find divisibility of number import java.util.*; //Scanner class … Continue reading Java program to find divisibility of number