New operator is used to create a new object of an existing class and associate the object with a variable that names it. Basically new operator instantiates a class by allocating memory for a new object and returning reference t...
Sunday, December 28, 2014
Monday, May 26, 2014
How to Define Methods with Behavior: Java
Objects have behavior that is implemented by its methods. Other objects can ask an object to do something by invoking its methods. This section tells you everything you need to know about writing methods for your Java classes.
I...
How to Declare Member Variables in Classes: JAVA
A class’s state is represented by its member variables. You declare a class’s member variables in the body of the class. Typically, programmer declare a class’s variables before you declare its methods, although this is not requi...
Sunday, May 18, 2014
How to Declare Classes with Members: JAVA
In order to bring a class into existence in Java program, it should be declared. A class is declared using keyword class. The generic syntax for class declaration in Java is:
Class <class_name>{ Statements defining class co...
How to Implement Object Oriented Design in JAVA
The basic unit of object-orientation in Java is the class. The class is often is described as a blueprint for an object. You can think of an object as an entity having a unique identity, characteristics and behaviour. For instanc...
Null Statement and Character Manipulation in JAVA
In Java programs, statements are terminated with a semicolon (;). The simplest statement of them all is the empty, or null statement.
; it is a null statement
A null statement is useful in those instances where the syntax of the...
Type of Statements used in JAVA
Statements are roughly equivalent to sentences in natural languages. A statement forms a complete unit of execution. The following types of expressions can be made into a statement by terminating the expression with a semicolon (...
Tuesday, May 13, 2014
Expression Evaluation and Compound Expression in JAVA
As discussed in earlier articles, expressions can either be pure expressions or mixed expressions. Pure expressions have all operands of same datatypes, contrary to mixed expressions that have operands of mixed datatypes.
Evalua...