java.lang

class Character

Introduction The java.lang.Character class includes many useful static methods with which text (or characters) can be manipulated. The other text manipulating classes are String, StringBuffer, StringTokenizer and StringBuilder. The Character class is a wrapper class for char data type. That is, a Character object represents char as an object; it gives an object form to …

class Character Read More »

instanceof Java Keyword

Introduction The instanceof keyword is very useful to know whether an object belongs to which class. The instanceof evaluates to true if an object belongs to a specified class or its super class; else raises compilation error. The following program illustrates. public class InstanceDemo { public static void main(String args[]) { String s1 = “hello”; …

instanceof Java Keyword Read More »

Object class

Introduction Object class has got very prominence in Java programming. In inheritance, it sits at the top of the hierarchy. That is, any Java class, either you write or predefined, should be a subclass of Object class. If you write any class, Java implicitly extends Object class. Why this? Java designers thought that some methods …

Object class Read More »

toString() method Convert Object to String form

About toString() method Summary: Java comes with two styles of converting object into string form. "toString() method Convert Object to String form" discusses using toString() method. We discussed toString() method in String class to some extent. Let us go more detailed here. toString() of Object class converts only objects into string form (remember, valueOf() of …

toString() method Convert Object to String form Read More »