Static keyword in Java with uses and Examples

Static keyword can be used with Variables Methods Blocks Static inner class lets see them one by one Static Variables in Java Static variable can be create by adding static keyword in front of variable. below count is static variable. A static variable is shared among all objects of class. Each class have their own … Read more

How to find String length in java string method

Get String length with String length() method To find String length in java there is a method length(). This method is used to get the length of the string. The signature of length method is:

The length method returns the length of the string. it counts the number of Unicode in string. str.length java … Read more

How to remove special characters from a string in java

Here we will see How to remove special characters from a string in java. Special characters are like & $ % @ ! < > etc that may occurs in string. To remove this we see programs how to remove special characters in java In Java String is a class that provides different constructors and … Read more

Login page in awt applet Java

Creating Login page in awt applet is easy. Here we are not using any layout. Login page contains two label, one textfield , one password field and two buttons. Steps by step process to develop this program is as below Declare Label, JTextField, JPasswordField and Button Inside init() create object for JLabel, JTextField and JPasswordField … Read more

User Defined exception in Java | Java custom exception examples

In Java programming, it is possible to create our own exceptions and such exception are called user-defined exceptions in Java. The exception class is a predefined class. Any user-defined exception created by us must be a subclass of the predefined Exception class and created by extending the Exception class. Read More Exception Handling in Java: … Read more

Employee details program in java using class and object

Employee details program in java as below. Here two classes are created Employee class EmployeeMain class Details of these two classes are as below java program for employee details using class and object employee class in java : Employee.java This class contains various fields of employees like id, fname, lname, address etc. Its corresponding getter … Read more

Java program to print vowels in a String

In Java, String is represented as an Object. String characters are represented in Unicode encoding. In the English language, there are five vowels a, e, i, o, and u. In any string, vowels can be in small or in large letters. Here using the Java program we will see how to find vowels in the … Read more

Sum of two numbers using command line arguments in java

Command line argument is as a way to pass arguments in java while running java program. Sum of two integer numbers using command line arguments in java Sum of two double numbers using command line arguments in java Conversion from String to number using Wrapper class How to check length of command line argument in … Read more

Prime number program in java using while loop

Here we generate and check prime number using while loop in java so that we titled this prime number program in java using while loop. 1 What is a Prime Number A prime number is a whole number that has only two factors 1 and the number itself. For example, 23 is a prime number, … Read more