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...
Type Conversion and its Types used in JAVA
An implicit type conversion is a conversion performed by the compiler without programmer’s intervention. An implicit conversion is applied generally whenever differing data types are intermixed in an expression (mixed mode expres...
Expressions and its types used in JAVA
An expressions is composed of one or more operations. The objects of the operation(s) are referred to as operands. The operations are represented by operators. Therefore, operators, constants, and variables are the constituents o...
Sunday, May 4, 2014
Operator Precedence and Associativity to Evaluate Expression: JAVA
Operator precedence determines the order in which expressions are evaluated. This, in some cases, can determine the overall value of the expression. For example, take the following expression:
Y = 6 + 4/2
Depending on whethe...
Other Remaining Operators used in JAVA Programming
All other remaining operators except assignment operators are listed in this article. Like instance of, shift operators, bitwise and many more described with example in the article.
The following table lists the other operators ...
Assignment and Shorthand Assignment Operators used in JAVA with Example
Java provides some assignment and shorthand operators listed in the article with example of each. The article also explains a table with all these assignment operators provided by JAVA Programming.
Like other programming languag...
Sunday, April 27, 2014
Solve Decision-Making Expression using Logical Operators in JAVA
Relational operators often are used with logical operators (also known as conditional operators sometimes) to construct more complex decision-making expression. The Java programming language supports six conditional operators-fiv...
Compare Values using Relational Operators in JAVA
In the term relational operator, relational refers to the relationships that values (or operands) can have with one another. Thus, the relational operators determine the relation among different operands.
Java provides six relat...
Monday, March 3, 2014
Increment and Decrement Operators in Java Programming
Earlier article was about the operators in java with some of the binary operators, example of each. This article is about plus (+) operator and increment/decrement operator in brief.
Operator + with strings
Programmer have used ...
Wednesday, February 26, 2014
How to Use Operators with Strings in Java Programming
Operator + with strings
You have used the operator + with numbers. When you use + with numbers, the result is also a number. However, if you use operator + with strings, it concatenates them e.g.
5 + 6 results in to 11.
“5” + “...
Wednesday, February 19, 2014
Types and Examples of Binary Operators in Java Programming part-2
Operators that act upon two operands are referred to as Binary Operators. The operands of a binary operator are distinguished as the left or right operand. Together, the operator and its operands constitute an expression.
Additi...
Thursday, February 13, 2014
Types and Examples of Operators in Java Programming part-1
In Java programming, the operations (specific tasks) are represented by operators and the objects of the operations (s) are referred to as operands.
Java’s rich set of operators comprise of arithmetic, relational, logical and cer...
What is the Scope of Variable in Java Programming?
In Java Programming, an important thing that you must know about variable is their scope. Scope generally refers to the program-region within which a variable is accessible. The board rule is: a variable is accessible with in the...