Friday, July 10, 2009

Easy step to study JAVA :: Operator

An operator is a symbol that operates on one or more arguments to produce a result. The Hello World program is so simple it doesn't use any operators, but almost all other programs you write will.

Operator Purpose
+ addition of numbers, concatenation of Strings
+= add and assign numbers, concatenate and assign Strings
- subtraction
-= subtract and assign
* multiplication
*= multiply and assign
/ division
/= divide and assign
% take remainder
%= take remainder and assign
++ increment by one
-- decrement by one
> greater than
>= greater than or equal to
< less than
<= less than or equal to
! boolean NOT
!= not equal to
&& boolean AND
|| boolean OR
== boolean equals
= assignment
~ bitwise NOT
?: conditional
instanceof type checking
| bitwise OR
|= bitwise OR and assign
^ bitwise XOR
^= bitwise XOR and assign
& bitwise AND
&= bitwise AND and assign
>> shift bits right with sign extension
>>= shift bits right with sign extension and assign
<< shift bits left
<<= shift bits left and assign
>>> unsigned bit shift right
>>>= unsigned bit shift right and assign

Easy step to study JAVA :: Primitive Data Type

Java's primitive data types are very similar to those of C. They include boolean, byte, short, int, long, float, double, and char. The boolean type has been added. However the implementation of the data types has been substantially cleaned up in several ways.

  1. Where C and C++ leave a number of issues to be machine and compiler dependent (for instance the size of an int) Java specifies everything.
  2. Java prevents casting between arbitrary variables. Only casts between numeric variables and between sub and superclasses of the same object are allowed.
  3. All numeric variables in Java are signed.

sizeof isn't necessary in Java because all sizes are precisely defined. For instance, an int is always 4 bytes. This may not seem to be adequate when dealing with objects that aren't base data types. However even if you did know the size of a particular object, you couldn't do anything with it anyway. You cannot convert an arbitrary object into bytes and back again.

boolean

1-bit. May take on the values true and false only.

true and false are defined constants of the language and are not the same as True and False, TRUE and FALSE, zero and nonzero, 1 and 0 or any other numeric value. Booleans may not be cast into any other type of variable nor may any other variable be cast into a boolean.

byte

1 signed byte (two's complement). Covers values from -128 to 127.

short

2 bytes, signed (two's complement), -32,768 to 32,767

int

4 bytes, signed (two's complement). -2,147,483,648 to 2,147,483,647. Like all numeric types ints may be cast into other numeric types (byte, short, long, float, double). When lossy casts are done (e.g. int to byte) the conversion is done modulo the length of the smaller type.

long

8 bytes signed (two's complement). Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807.

float

4 bytes, IEEE 754. Covers a range from 1.40129846432481707e-45 to 3.40282346638528860e+38 (positive or negative).

Like all numeric types floats may be cast into other numeric types (byte, short, long, int, double). When lossy casts to integer types are done (e.g. float to short) the fractional part is truncated and the conversion is done modulo the length of the smaller type.

double
8 bytes IEEE 754. Covers a range from 4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative).
char

2 bytes, unsigned, Unicode, 0 to 65,535

Chars are not the same as bytes, ints, shorts or Strings.

Easy step to study JAVA :: What's Java

The term Java actual refers to more than just a particular language like C or Pascal. Java encompasses several parts, including :

  • A high level language � the Java language is a high level one that at a glance looks very similar to C and C++ but offers many unique features of its own.

  • Java bytecode - a compiler, such as Sun's javac, transforms the Java language source code to bytecode that runs in the JVM.

  • Java Virtual Machine (JVM) � a program, such as Sun's java, that runs on a given platform and takes the bytecode programs as input and interprets them just as if it were a physical processor executing machine code.

Sun provides a set of programming tools such as javac, java and others in a bundle that it calls a Java Software Development Kit for each version of the language and for different platforms such as Windows, Linux, etc.. Sun also provides a runtime bundle with just the JVM when the programming tools are not needed.

Note that because of the open nature of Java (see below), any or all of these parts can be replaced by non-Sun components. For example, just as many different languages can create machine code for a given processor, compilers of other languages have been created that output bytecode to run in the JVM. Similarly, many JVMs have been written by groups outside of Sun.

In this book and web course, when we use the term Java we are referring to the the high level language unless noted otherwise. Also, those packages that come with the SDK for a given version will be referred to as comprising the core language for that version, as distinguished from optional or third party packages.

Java, Open or Closed?

Java is not quite an open language but not quite a proprietary one either. All the core language products - compiler, virtual machines (VM), class packages, and other components - are free. Detailed specifications and source code are made openly available.

The Java Community Process (JCP) leads the development of new standards for the language.
Other companies and organizations can legally create a clean sheet compiler and/or a Virtual Machine as long as it follows the publicly available specifications. Microsoft did this with the Version 1.1 JVM that it used in its Internet Explorer browser.

Sun, however, does still assert final say on the specifications and controls the copyrights to logos, and trademarks.

For example, Microsoft's VM differed in a some significant details from the specifications and Sun accused Microsoft of attempting to weaken Java's "write once, run anywhere" capabilities. Sun sued Microsoft and the dispute was later settled out of court.

Easy step to study JAVA 1:: History

Around 1990 James Gosling , Bill Joy and others at Sun Microsystems began developing a language called Oak. The wanted it primarily to control microprocessors embedded in consumer items such as cable set-top boxes,VCR's, toasters, and also for personal data assistants (PDA).

To serve these goals, Oak needed to be:

    • Platform independent (since multiple manufacturers involved)
    • Extremely reliable
    • Compact.

However, as of 1993, interactive TV and PDA markets had failed to take off. Then the Internet and Web explosion began, so Sun shifted the target market to Internet applications and changed the name of the project to Java.

By 1994 Sun's HotJava browser appeared. Written in Java in only a few months, it illustrated the power of applets, programs that run within a browser, and also the capabilities of Java for speeding program development.

Riding along with the explosion of interest and publicity in the Internet, Java quickly received widespread recognition and expectations grew for it to become the dominant software for browser and consumer applications.

However, the early versions of Java did not possess the breadth and depth of capabilities needed for client (i.e. consumer) applications. For example, the graphics in Java 1.0 seemed crude and clumsy compared to mature software developed with C and other languages.

Applets became popular and remain common but don't dominate interactive or multimedia displays on web pages. Many other "plug-in" types of programs also run within the browser environment.

So Java has not succeeded at development of consumer applications. However, Java's capabilities grew with the release of new and expanded versions (see below) and it became a very popular language for development of enterprise, or middleware, applications such as on line web stores, transactions processing, database interfaces, and so forth.

Java has also become quite common on small platforms such as cell phones and PDAs. Java is now used in several hundred cell phone models. Over 600 million JavaCards, smart cards with additional features provided by Java, have been sold as of the summer of 2004.

Easy step to study JAVA :: Java Software

Before we start.

  1. You should have the software in your system.... if you don't have please download in Sun website

Download

2. For Beginner you should spend 1/2 hrs every day for study both of theory and program....

3. Try to executed all the program in my blog...

Wednesday, July 8, 2009

EJB book is avaliable right now!!!

EJB ::Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform, Enterprise Edition (Java EE). EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology.

EJB 3.0 Specification Final Release
This specification defines the new simplified EJB API targeted at ease of development. It also includes the new Java Persistence API for the management of persistence and object/relational mapping with Java EE and Java SE.

Java Persistence API
The Java Persistence API is the standard API for the management of persistence and object/relational mapping. It provides an object/relational mapping facility for application developers using a Java domain model to manage a relational database. The Java Persistence API is part of the Java EE platform. It can also be used in Java SE environments.

EJB 2.1 specification
This spec, created under the Java Community Process (JCP), enhances EJB architecture with support for Web services, making it easier to implement and deploy Web services applications based on Java technology.






Sunday, July 5, 2009

ประเดิม blog ด้วย ตระกูล HEAD FIRST ::]

หนังสือตระกูล Head first ของ O'Reilly คงเป็นสำหนังพิมพ์ที่หลายๆ คนชอบอ่าน

ด้วยรูปเล่ม การจัดวางหน้าที่สวยงาม

บวกกับ ความง่ายของภาษา

ภาพประกอบ ที่น่ารัก และ

ง่ายต่อการเข้าใจ

เรามารู้จักหนังสือตระกูล Head first กันเลยดีกว่า!!!

=======================================================

เล่มแรก


--->Download<---



--->Download<---


--->Download<---



--->Download<---



--->Download<---