Java Unassigned Variables

Unassigned Local and Instance Variables Summary: In this "Java unassigned variables" tutorial, you will learn Java nature of unassigned variables which quiet contract to C/C++. One of the features of Java is "Java does not support garbage values". If a variable is used without a value assigned, it is either…

Applets Vs Applications Java

All Java programs can be classified as Applications and Applets. The striking differences are that applications contain main() method where as applets do not. One more is, applications can be executed at DOS prompt and applets in a browser. We can say, an applet is an Internet application. Come on,…

Suspend Resume Thread Java

Introduction to Suspend Resume Thread When the sleep() method time is over, the thread becomes implicitly active. sleep() method is preferable when the inactive time is known earlier. Sometimes, the inactive time or blocked time may not be known to the programmer earlier; to come to the task here comes…

class Random Generate random numbers

class Random Generate random numbers Summary: By the time you complete this "class Random Generate random numbers", you will understand of how to generate random numbers in Java. Introduction to class Random Generate random numbers Generating different numbers at different times of execution, by the same program, is known as…

Java String Immutable Comparison

Java String Immutable Comparison Summary: At the end of this tutorial "Java String Immutable Comparison", you will understand the meaning of immutable. Also you will come to know the styles of comparing Java strings. String handling and string manipulation play a vital role in programming. The simplicity in handling makes…

substring() Extract Part of a String

Here, we use the overloaded methods of substring() to extract the whole or a part of a string. Following is the signature of overloaded substring() method as defined in String class. String substring(int indexNum): Returns a string containing all the characters existing from indexNum to the end in the given…

Convert Data type Java String

Convert Data type Java String Summary: Many a times, it is required in Java coding to convert string to data types or data types to string. This tutorial "Convert Data type Java String" does this job. In parsing operations, we convert strings into data types. Sometimes, code demands to convert…

regionMatches() and intern() String Java

The String class is rich with abundant methods used in coding. One of the methods is overloaded regionMatches() used to find the existence of a few characters of one string in another. Supported methods from String class. boolean regionMatches(int positionFirstString, String secondString, int positionSecondString, int num): Returns a boolean value…

Arrays Introduction Tutorial Properties

Arrays Introduction Tutorial Properties Summary: This tutorial "Arrays Introduction Tutorial Properties", discusses arrays properties in simple terms, example code and screenshots. Start reading. Array is a data structure capable to hold data of similar data types. Every language comes with its own rules for arrays. For example, JavaScript and VBScript…

Reference Variables Objects Anonymous objects

Reference Variables Anonymous objects Summary: By the end of this tutorial "Reference Variables Anonymous objects", you will be comfortable in creation of Java objects, reference variables and anonymous objects. Java includes two types of variables – primitive variables and reference variables. A primitive type refers a primitive data type and…

Java Naming Conventions Readability

Java Naming Conventions Readability Summary: Unlike C/C++, Java comes with naming conventions to increase the readability of code. This "Java Naming Conventions Readability" explains how to do it. After knowing the rules of identifiers, it is the time to know the another grammar of Java known as "conventions". Conventions increase…

Java static Variable Method

Java static Variable Method Summary: By the end of this tutorial "Java static Variable Method", you will comfortable to write programs with static variables and methods. After discussing the usage of "this" keyword, let us move to another keyword "static". The "static" keyword is used as an access modifier. Java…

Data Binding Data Hiding Encapsulation

Data Binding Data Hiding Encapsulation Summary: This tutorial "Data Binding Data Hiding Encapsulation "is targeted as a good starting point for those who are new to OOPS concepts. Even if you are familiar with, start reading and you may find something useful that you have not known earlier. Or you…

Inheritance Tutorial Java

Composition vs Inheritance After Encapsulation, the second OOPS feature is "Inheritance". In the previous Parrot program, the Parrot created an object of Bird and used Bird's method eat(). Now in inheritance, we call the eat() method with Parrot object itself (and not with Bird object). This is the difference between…

Search, Append and Insert StringBuffer Methods

Very often used many StringBuffer Methods are discussed with Examples and Screenshots in Simple terms for a Beginner. StringBuffer Methods for Searching characters The indexOf(), lastIndexOf() and charAt() methods existing in String class also exist in StringBuffer class. They can be used with StringBuffer object. The meaning of the methods…

StringBuffer substring Java Pass By Reference

StringBuffer substring Java Pass By Reference Many petty methods exist with StringBuffer like substring(), setLength() and trimToSize() etc. These methods are not much used in regular programming.

Output screen of MiscellaneousMethods.java of StringBuffer substring Java Pass By Reference substring() method works the same way of strings. setLength() and trimTosize()…

Hierarchy Exceptions Checked Unchecked Exceptions

Hierarchy of Exceptions (Checked Unchecked Exceptions) After knowing exceptions and exception handling mechanism, let us explore how many exceptions exist, are they inheriting from a common super class, any classification exists or not etc. Whenever you come across a new Java class, it is essential to know its super classes,…

Interfaces Multiple Inheritance Java

We know earlier, Java does not support multiple inheritance, basically. But to support multiple inheritance, partially, Java introduced "interfaces". An interface is not altogether a new one for us; just it is a special flavor of abstract class where all methods are abstract. That is, an interface contains only abstract…