Java Tutorials

331. The Benefits of OOP

By: aathishankaran : 2007-02-20

Description: OOP offers several benefits to the program designer and the user. Object-orientation contributes to the solutions of many problem associated with the development and quality of software products. The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost. The principal advantages are:


332. Class Fundamentals in Java

By: aathishankaran : 2007-02-20

Description: Classes have been used since the beginning of java. However, until now, only the most rudimentary form of a class has been used. The classes created in the preceding chapters primarily exist simply to encapsulate the main () method, which has been used to demonstrate the basics of the java's syntax. As you will see, classes are substantially more powerful than the limited ones presented so far.


333. Declaring objects in Java

By: aathishankaran : 2007-02-20

Description: When you create a class, you are creating a new data type. You can use this type to declare objects of that type. However, obtaining objects of a class is a two-step process. First, you must declare a variable of the class type. This variable does not define an object. Instead, it is simply a variable that can refer to an object. Second, you must acquire an actual, physical copy of the object and assign it to that variable. You can do this using the new operator.


334. Operator Precedence

By: aathishankaran : 2007-02-07

Description: Table shows the order of precedence for java operators, from highest to lowest. Notice that the first row shows items that you may not normally think of as operators: parentheses, square brackets, and the dot operator. Parentheses are used to alter the precedence of an operation. As you know from the previous articles, the square brackets provide array indexing. The dot operator is used to dereference objects and will be discussed later.


335. The ? Operator

By: aathishankaran : 2007-02-07

Description: Java includes a special ternary (three-way) operator that can replace certain types of if-then-else statements. This operator is the ?, and it works in java much like it does in C and C++. It can seem somewhat confusing at first, but the ? can be used very effectively once mastered. The ? has this general form:


336. Short-Circuit Logical Operator

By: aathishankaran : 2007-02-07

Description: Java provides two interesting Boolean operators not found in most other computer languages. These are secondary versions of the Boolean AND and OR operators, and are known as short-circuit logical operators. As you can see from the preceding table, the OR operator results in true when A is true, no matter what B is


337. Relational Operators

By: aathishankaran : 2007-02-07

Description: The relational operators determine the relationship that one operand has to the other. Specifically, they determine equality and ordering, the relational operators are shown here:


338. Boolean Logical Operators

By: aathishankaran : 2007-02-07

Description: The boolean logical operators shown here operate only on boolean operands. All of the binary logical operators combine two boolean values to form a resultant boolean value.


339. Bitwise Operator Assignments

By: aathishankaran : 2007-02-07

Description: All of the binary bitwise operators have a shorthand form similar to that of the algebraic operators, which combines the assignment with the Bitwise operation. For example, the following two statements, which shift the value in a right by four bits, are equivalent:


340. The Left Shift

By: aathishankaran : 2007-02-06

Description: The left shift operator, <<, shifts all of the bits in a value to the left a specified number of times. It has this general form: