substring

Try and Catch Statements

Submitted by GeePee on
Introduction: This page will teach you about the Try and Catch statements in Java. What is a Try and Catch statement? A Try and Catch statement is a very handy statement which allows the program to handle errors and warnings thrown by the scripts. Each Try and Catch statement contains the block of script to handle, a single or multiple exception(s) followed by block(s) of script which are executed if that specific exception is thrown by the handled script.

How to get a SubString of a String in Java

Submitted by donbermoy on
This is a tutorial in which we are going to create a program that gets substring of a string in java. We all know that a substring is a part of a sentence or a string. Java String class provides substring method with some overloaded parameter. So, now let's start this tutorial! 1. Open JCreator or NetBeans and make a java program with a file name of subString.java. 2. Import java.lang package because in this library, substring class is there.