FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
What is Java?

 
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Client - Server Side Development
Author Message
Singachea
fourth grade


Joined: 19 Nov 2005
Posts: 258

PostPosted: Tue Nov 29, 2005 2:19 am    Post subject: What is Java? Reply with quote

I learnt a very short term about Java and I hope you guys can share more about this.

At first, we should know some history of Javas.

What is Java? Who created it? why is it called Java? for what?

* Java is one of the high level computer programming language.

* Java is designed by a team led by Jame Gosling

* The orginal name of Java was oak, and after that the team knew that the name oak was already taken. Java was named after Jame visited a local coffee shop.

* Java firstly was created for embedding in microelectronic device

How many editions are there for Java?

* There are 3 editions: J2EE, J2SE, and J2ME
++ J2EE: Java 2 platform Enterprise Edition
++ J2SE: Java 2 platform Standard Edition
++ J2ME: Java 2 platform Micro Edtion

I used to be confused with JDK, JRE and IDE. If you don't know, let's see:

JDK : Java Development Kit
JRE : Java Run-time Environment
IDE : Intergrated Development Environment

If we want to learn about Java, we need to install JDK because it comprises the compiler.

Some of you may sometimes be unable to play yahoo game. This is due to your computer doesn't detect JRE. JRE contains library that allows you to run applet.

IDE is just only the shell that makes you convenient to interact with JDK


Why should we learn Java? why not other languages?

The reason is that Java is:

Simple: Java is designed as closed to C++ as possible in order to make the system more comprehensible. Another aspect of being simple is being small.

Object Oriented: it is a technique for programming that focuses on the data (=objects) and on the interfaces to that object.

Distributed: Java has an extensive library of routines for coping with TCP/ IP protocols like HTTP and FTP. Java applications can open and access objects across the Net via URLs with the same ease as when accessing a local file system.

Robust: Java is intended for writing programs that must be reliable in a variety of ways. Java puts a lot of emphasis on early checking for possible problems, later dynamic (run-time) checking, and eliminating situations that are error-prone…. The single biggest difference between Java and C/C++ is that Java has a pointer model that eliminates the possibility of overwriting memory and corrupting data.

Secure: Java is intended to be used in networked/ distributed environments. Toward that end, a lot of emphasis has been placed on security. Java enables the construction of virus-free, tamper-free systems.

Architecture neutral: Java compiler generates bytecode instructions which have nothing to do with a particular computer architecture. Rather, Java is designed to be both easy to interpret on any machine and easily translated into native machine code on the fly.

Portable: there are no “implementation-dependent” aspects of the specification in Java. The sizes of the primitive data types are specified, as is the behavior of arithmetic on them.

Interpreted: Java interpreter can execute Java bytecodes directly on any machine to which the interpreter has been ported. Since linking is a more incremental and light-weight process, the development process can be much more rapid and exploratory.

High performance: while the performance of interpreted bytecodes is usually more than adequate, there are situations where higher performance is required. The bytecodes can be translated on the fly (at run time) into machine code fro the particular CPU the application is running on.

Dynamic: Java was designed to adapt to an evolving environment. Libraries can freely add new methods and instance variables without any effect on their clients. In Java, finding out run time type information is straightforward.



(to be continued coz i'm sleepy now)

Back to top
guitarman
fourth grade


Joined: 04 Nov 2005
Posts: 728

PostPosted: Thu Dec 01, 2005 12:51 pm    Post subject: Reply with quote



Awesome post, m8. Thank you for sharing such a comprehensive articles.
I still not very clear the different betweend the JDK and JRE. I thought if you have (installed) JRE already, why would you need the JDK for?

Back to top
Singachea
fourth grade


Joined: 19 Nov 2005
Posts: 258

PostPosted: Thu Dec 01, 2005 3:55 pm    Post subject: Reply with quote

Hi brother

I didn't say if we installed jre, and then we needed to install jdk.

Like what i mentioned, jre is the library (player) to run applet which is similar to flash player which runs .swf

jdk is compiler which can compile .java file into bytecode .class file. it's similar to the flash compiler which compiles .fla

Actually, jdk also contains jre.

Back to top
Singachea
fourth grade


Joined: 19 Nov 2005
Posts: 258

PostPosted: Thu Jan 12, 2006 1:11 am    Post subject: Reply with quote

I found that this article is interesting...

Thank God for Java
Java is the most notable programming language of recent years. How does it work and what is good, and not good, at?
By David Cartwright, Techworld


What is Java? Java is a programming language which was devised within Sun Microsystems in the mid-1990s (most notably by James Gosling, an appropriately-bearded genius who, although the language as we know it today is the collective work of dozens, if not hundreds of people, is regarded as Java's creator).


The motivations behind Java are many and varied. Had it been "just another computer language" it would never have taken off - after all, the world already had C, C++, BASIC, Ada, COBOL, FORTRAN, Smalltalk and any number of others. Instead, it pushed the boundaries of programming languages in a number of ways.


Object-oriented
Although object-oriented (OO) languages had been around (in the form of Smalltalk et al) for donkey's years, Java brought object orientation to the masses. Although C++ had been a valiant attempt to bring OO to the ever-popular C, it was always a bit of a nasty bolt-on kludge, whereas Java was inherently object-oriented from the ground up. It was no accident that the syntax of Java, although more extensive than C++, resembled C/C++ sufficiently to make it reasonably straightforward for a C++ developer to migrate his skills into the Java world.


Network-aware
Although C, with its foundations in the Unix world, has been inherently capable of working at a very low level with networks, Java's creators took note of the fact that the Internet was clearly going to be huge. IP networking, in particular, was going to rule the world and made the language's networking abilities a much more high-level concept. Although you can fart about with low-level sockets, if you wish, you can also give Java a simple URL and say: "Go use that bit of code over there" in next to no code. In a single swipe, distributed code re-use was a reality - a massive leap forward when compared to languages of the past.


Architecture-independent
The third key aspect of Java is that when you write a Java program and compile it, you're not actually compiling it in the true sense of the word. Traditionally, compilation means that you take some high-level code, run it through a compiler and end up with a program that will execute only on a single type of CPU, running a specific operating system. Compile a program on an Intel machine running Windows and you'll get a program that'll only run on another Intel machine running Windows. Okay, you can get cross-compilers that allow you to (say) tell the compiler to output code for a Mac running MacOS 9 even though it's on a Windows-based PC, but the rule still applies - the resulting code will run only on a Mac with MacOS 9.


With Java, the finished product is actually somewhere between the high-level code and the architecture-specific machine code; the form is termed "bytecode". In order to run a Java program, you need to first install a "Java virtual machine" (JVM) on whatever computer you want to run it on. The JVM takes the bytecode and converts it, on the fly, into machine-specific instructions that are then run on the computer's processor. This means that any compiled Java program can run on any machine equipped with a JVM, regardless of its processor or operating system, a massive potential bonus for software developers.


Java's good points
The main benefits to Java, then, are:


• It's a language that is reasonably easy to learn (and indeed, it's used as the first teaching language in many universities). It's easy for C and C++ developers, in particular, to pick up Java.

• It's a write once, run anywhere kind of language - a Java program will run on any JVM-equipped computer (which these days means anything from a pocket computer to an IBM mainframe).

• Unlike certain proprietary systems (Delphi or VB, for instance) the language is open and in most cases you can pick up a compiler (and even a natty GUI-based development environment) for free.

• It provides immense potential for code re-use, which in turn brings the potential for very rapid application development.

• Since its inception in 1996, peripheral developments have taken place to ensure it has kept up with, for example, database integration and XML integration, so it's still a modern language.


Java's bad points
The only real downside with Java is its performance. When Sun first touted Java as a product, it went hand-in-hand with the JavaStation - a diskless workstation that Sun hoped would lead the migration of the world toward diskless, "thin client" computing. Although the first JavaStations performed poorly, this wasn't perceived as a problem because the intention was always to produce a Java-specific microprocessor that would massively enhance the performance of the language.


This processor never quite made it off the drawing board, though, which means that to this day Java is still an interpreted language - that is, when you run a program, the JVM has to take the bytecode and expend a wad of processor and memory converting it into the machine code that the host machine can run. There have been valiant attempts to optimise this conversion process - most notably using the Just-In-Time, or JIT compiler, which instead of compiling the whole program at once, predicatively converts lumps of code just before they're likely to be needed. Regardless of the optimisation attempts that have been made, though, Java code is generally much slower than a natively-compiled equivalent.


Java programs can also have big memory footprints - particularly when you consider that to run a program, the JVM has to be in memory as well. A quick check on the binaries directory of the latest Sun JVM for Windows reveals that there's over 7MB of stuff in there - and although this isn't all in RAM at once, it's an overhead that you can do without in the average computer. Even Sun's internal Java guys have raised performance and memory hunger as huge issues - have a look at this link for the evidence.


Summary
Java is an immensely powerful language and is absolutely certain to play a key role in the future of corporate computing. In these days when people, like IBM, talk of plonking a JVM on every computer in the enterprise and using the entire building's computing power as a single distributed processor, Java is, and will always be, the only candidate for the language in which the business applications will be written.


Even without this move to "amorphous blob computing" (did we just invent a new term there?) Java is hugely attractive for software vendors, as they only have to write and compile their applications once and they'll run on pretty well any platform.


For now, though, Java's use in centralised, multi-user systems where performance counts is questionable. Experience has shown that although it'll work just great if you can throw CPU cycles and masses of RAM at it, if you're developing (say) a customer-facing Web application, you'd probably shy away from Java on the average mid-range Web application.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cambodia eXPlore Forum Index -> Client - Server Side Development All times are GMT + 8 Hours
Page 1 of 1



by phpBB