Sunday, December 25, 2011

operator in JAVA

An operator is a symbol that tell the computer to perform certain mathematical or logical manipulation.

Java operators are divided into eight categories: assignment, arithmetic, relational, logical, bitwise,
compound assignment, conditional, and type
.


 Assignment Operators         =
 Arithmetic Operators         -        +        *        /        %        ++        --
 Relational Operators         >        <        >=        <=        ==        !=
Logical Operators && || & | ! ^ Bit wise Operator & | ^ >> >>> Compound Assignment Operators += -= *= /= %=
         <<=        >>=     >>>=
 Conditional Operator         ?:
 
For more information visit programming-training.com 

Wednesday, December 21, 2011

Integer Constants in JAVA

An integer constant refers to a sequence of digits.Their are three types of integer

* Decimal Integer

Decimal integer consist of set of digit, 0 through 9. Example of decimal integer constants are: 156          -321      0       45689

Note : Embeded spaces, commas, and non-digit character are not permited between digits.

# Octal Integers

An octal integer constant consist of any combination of any combination of digit from 0 through 7, with a leading 0.Example of octal integer are:038         0        0564        06891

* Hexadecimal integer

A sequence of digit preceeded by 0x or 0x is considered as hexadecimal integer.In that include alphabets A through F or a through f.Example of hexadecimal integer is0x2       0x9F       0xbcd        0x









Example of Java Constant 

class IntConstant
{
public static void main(string args[])
{
int i=10;
System.out.println("Integer Contant Values : " +i);
}
}


Output of a Programme

Integer Contant Values : 10

Sunday, December 18, 2011

PHP History


PHP's structure is heavily influenced by the C programming language, a general-purpose language that has existed since 1978 and has been used to develop many large programs, including UNIX and Microsoft Windows. C's popularity led many subsequent languages to use its same general syntax, so that programmers familiar with C would quickly feel comfortable using the new language instead. Other C-based languages include C++, Java, Perl, JavaScript, and C#. Of course, all are fairly distinct languages, but since all of these languages have a similar core, you will find them fairly familiar after seeing PHP.

PHP development is continuing, as those on the PHP team refine the language to enhance its security, to facilitate development of large-scale Web sites, and provide other new features. As of mid-2007, when this was written, the current official version of PHP is version 5, although version 6 is nearing completion. Version 4 is still in wide use, partially because people haven't gotten around to installing the newer versions — but also because established Web sites need to take issues like security and reliability very seriously, and version 4 is a more thoroughly tested software package

Friday, December 16, 2011

History of C++

The history of C++ begins with C. C++ is built upon the foundation of C. Thus, C++ is a superset of C. C++ expanded and enhanced the C language to support object-oriented programming (which is described later in this module). C++ also added several other improvements to the C language, including an extended set of library routines.

C++ was invented by Bjarne Stroustrup in 1979, at Bell Laboratories in Murray Hill, New Jersey. He initially called the new language “C with Classes ” However in 1983 the name was changed to C++ Stroustrup built C++ on the foundation of C including all of C's features attributes and benefits

Wednesday, December 14, 2011

Primitive Data Types

The Java programming language is statically-typed, which means that all variables must first be declared before they can be used.

  • byte: The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The byte data type can be useful for saving memory in large arrays, where the memory savings actually matters. They can also be used in place of int where their limits help to clarify your code; the fact that a variable's range is limited can serve as a form of documentation.
  • short: The short data type is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32,767 (inclusive). As with byte, the same guidelines apply: you can use a short to save memory in large arrays, in situations where the memory savings actually matters.
  • int: The int data type is a 32-bit signed two's complement integer. It has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647 (inclusive). For integral values, this data type is generally the default choice unless there is a reason (like the above) to choose something else. This data type will most likely be large enough for the numbers your program will use, but if you need a wider range of values, use long instead.
  • long: The long data type is a 64-bit signed two's complement integer. It has a minimum value of -9,223,372,036,854,775,808 and a maximum value of 9,223,372,036,854,775,807 (inclusive). Use this data type when you need a range of values wider than those provided by int.
  • float: The float data type is a single-precision 32-bit IEEE 754 floating point.
  • double: The double data type is a double-precision 64-bit IEEE 754 floating point.
  • boolean: The boolean data type has only two possible values: true and false. Use this data type for simple flags that track true/false conditions. This data type represents one bit of information, but its "size" isn't something that's precisely defined.
  • char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).

    Variable in JAVA

Tuesday, December 13, 2011

Java Identifiers

In java there are several points to remember about identifiers. They are as follows:
  • All identifiers should begin with a letter (A to Z or a to z ), currency character ($) or an underscore (-).
  • After the first character identifiers can have any combination of characters.
  • A key word cannot be used as an identifier.
  • Most importantly identifiers are case sensitive.
  • Examples of legal identifiers:age, $salary, _value, __1_value
  • Examples of illegal identifiers : 123abc, -salary