Write a program to find greatest number in a 3*3 array

Write a program to find the greatest number in a 3*3 array. The program is supposed to receive 9 integer numbers as command-line arguments. Program to Print 3*3 array in Java Reading 9 integer numbers as command-line arguments and assigning it to 3*3 matrix and printing it Program Steps are Create a Java class declare … Read more

User Defined exception in Java | Java custom exception with examples

In Java programming, it is possible to create our own exceptions and such exception are called user-defined exceptions in Java. 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: Hierarchy … Read more

Throw and Throws Keywords in Java

In java programming, If the exception occurs within the try block it is thrown. Throw and Throws Keywords in Java is very important to throw exceptions. a throw keyword is used to throw an exception A system-generated exception is automatically thrown by the java run time system but if we want to manually throw an … Read more

Exception Handling in Java with Examples

To learn about exception handling first you must know what is an exception What is an Exception in Java An exception is run time error that can occur due to wrong user input or due to logical error in programming. Arithmetic Exception Example Consider a simple example. Take two integer number from command prompt and … 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

Java string replace:string character whitespace vowel regex

Here we will see Java string replace examples with replacing the string, replacing characters, replacing whitespace vowels, and using a regular expression to replace string and substring. Java string replace Example: use of replace() Java String replace() is used to replace substring in given string.

In this example, Joker is replaced with Poker and … Read more

Login form in Java Swing and MySql Database connectivity source code

We considered a small example with student details to login From Java Swing and redirecting to another frame after login. Java login form with MySQL database connection in Netbeans Here we have created a swing login form in java and connected that form with MySQL database and provide all validation related to that. Registration Form … Read more

Write a method max that has two string parameters and returns the larger of the two.

Method max that has two string parameters and returns the larger of the two using String.length() Method max that has two string parameters and returns the larger of the two using conditional operator. Method max that has two string parameters and returns the larger of the two using String.length()

Method max that has … Read more

Methods in Java-how to call a method in java

Introducing Method In java programming language classes usually consist of two things instance variable and methods. What is a method in java                                                                  A method is the block of statements that performs a special task. Using methods we can avoid rewriting the same code over and over in a sane program. The method increases the … Read more