Java (programming language): Wikis

  
  

Encyclopedia

From Wikipedia, the free encyclopedia

Java
Java logo.svg
Usual file extensions .java, .class, .jar
Paradigm Object-oriented, structured, imperative
Appeared in 1995
Designed by Sun Microsystems (Now owned by Oracle Corporation)
Developer James Gosling & Sun Microsystems
Stable release Java Standard Edition 6 (1.6.0_18) (January 14, 2010; 55 day(s) ago (2010-01-14))
Typing discipline Static, strong, safe, nominative, manifest
Major implementations Numerous
Dialects Generic Java, Pizza
Influenced by Ada 83, C++, C#,[1] Delphi Object Pascal,[2] Eiffel,[3] Generic Java, Mesa,[4] Modula-3,[5] Objective-C,[6] UCSD Pascal,[7][8] Smalltalk
Influenced Ada 2005, C#, Clojure, D, ECMAScript, Groovy, J#, PHP, Scala, JavaScript, Python, BeanShell
OS Cross-platform (multi-platform)
License GNU General Public License / Java Community Process
Website java.sun.com
.Java is a programming language originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform.^ Java was created at Sun Microsystems, Inc.
  • Java (computer programming language) -- Britannica Online Encyclopedia 10 January 2010 20:48 UTC www.britannica.com [Source type: Reference]

^ TAGS: scripting language , Java , Java program , Sun Microsystems Inc.
  • Java news, reviews and downloads on CNET 10 January 2010 20:48 UTC www.cnet.com [Source type: General]

^ The original J2EE specification was developed by Sun Microsystems .
  • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

.The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities.^ The language derives much of its syntax from C and C++ but has a simpler object model JavaScript , a scripting language , shares a similar name and has similar syntax, but is not directly related to Java.
  • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

^ The language itself borrows much syntax from C and C++ but has a simpler object model and fewer low-level facilities.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Not because its syntax is any simpler, but more because there are fewer surprises.
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

.Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture.^ It can compile Java source code to Java bytecode (class files) or directly to native machine code, and Java bytecode to native machine code.
  • GCJ: The GNU Compiler for Java- GNU Project - Free Software Foundation (FSF) 10 January 2010 20:48 UTC gcc.gnu.org [Source type: FILTERED WITH BAYES]

^ Running a Java application on Strauss.
  • Unix program: Java 10 January 2010 20:48 UTC www.udel.edu [Source type: FILTERED WITH BAYES]

^ Java language and compiler; the Java Virtual Machine for running platform independent bytecode; the Java API frameworks of class libraries.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

.Java is general-purpose, concurrent, class-based, and object-oriented, and is specifically designed to have as few implementation dependencies as possible.^ Object-Oriented: Almost everything in Java is either a class, a method or an object.
  • Cetus Links: 16604 Links on Objects and Components / Java / General 10 January 2010 20:48 UTC www.cetus-links.org [Source type: Academic]

^ For this purpose Java provides the StreamTokenizer class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ An object is a specific instance of a class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.It is intended to let application developers "write once, run anywhere". Java is considered by many as one of the most influential programming languages of the 20th century, and widely used from application software to web application.^ Developing Ajax Web Applications using ThinWire and Java ThinWire makes it as easy to develop rich web applications as it is to write standalone Java applications.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ Because of this, Java is not considered to be a pure object-oriented programming language.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Ajax (programming) ; Programming language Semantic web .
  • Java (programming language) | Faviki. Tags that make sense. 2 February 2010 15:16 UTC www.faviki.com [Source type: FILTERED WITH BAYES]

[9][10]
.The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of their Java technologies under the GNU General Public License.^ The first public implementation was Java 1.0 in 1995.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ GNU Compiler for the Java Programming Language (GCJ) This Java compiler is developed independently of the one by Sun.
  • Free Java Compilers and Assemblers, Free Native Code Java Compilers and Java Development Kits (thefreecountry.com) 10 January 2010 20:48 UTC www.thefreecountry.com [Source type: General]

^ Sun's license for Java insists that all implementations be "compatible".
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

.Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath.^ GNU Compiler for the Java Programming Language (GCJ) This Java compiler is developed independently of the one by Sun.
  • Free Java Compilers and Assemblers, Free Native Code Java Compilers and Java Development Kits (thefreecountry.com) 10 January 2010 20:48 UTC www.thefreecountry.com [Source type: General]

^ Sun's implementation of Java is nonfree.
  • Free but Shackled - The Java Trap 10 January 2010 20:48 UTC www.gnu.org [Source type: FILTERED WITH BAYES]

^ Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath .
  • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

Contents

History

Duke, the Java mascot
.James Gosling initiated the Java language project in June 1991 for use in one of his many set-top box projects.^ I am a Java advocate, but I have many gripes with the Java language.
  • "Java Is Dead, Long Live Java!" – The Future of Java | JAVA Developer's Journal 10 January 2010 20:48 UTC java.sys-con.com [Source type: General]

^ We use a standard set of them in describing Java.
  • The Java(tm) Language: An Overview 10 January 2010 20:48 UTC java.sun.com [Source type: FILTERED WITH BAYES]

^ Java was started as a project called "Oak" by James Gosling in June 1991.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

[11] .The language, initially called Oak after an oak tree that stood outside Gosling's office, also went by the name Green and ended up later renamed as Java, from a list of random words.^ Since I wrote these words, originally, I found the the answer: Corel has a beta version of an all Java office suite almost ready.
  • JAVA FOR DERIVATIVES 10 January 2010 20:48 UTC www.margrabe.com [Source type: FILTERED WITH BAYES]

^ Due to the large size of the later versions of the language, the Java Foundation Classes (which you will need if you are writing Java applets) are covered separately in the companion book, Java Foundation Classes in a Nutshell .
  • Free Java Compilers and Assemblers, Free Native Code Java Compilers and Java Development Kits (thefreecountry.com) 10 January 2010 20:48 UTC www.thefreecountry.com [Source type: General]
  • Free Java Class Libraries, Source Code, Applets, Beans and Frameworks (thefreecountry.com) 10 January 2010 20:48 UTC www.thefreecountry.com [Source type: General]

^ As per the announcement that’ll sooner or later turn up on the official JavaFX blog: 3 hours ago Java Mortgage Calculator Help .
  • Java Articles, Posts, Blogs, Videos - Technorati 10 January 2010 20:48 UTC technorati.com [Source type: General]

[12] .Gosling aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation.^ A virtual machine (VM) is a software implementation of a machine (i.e.
  • Journal de nicOnicO: Lisaac: sorti de la 0.39beta 2 February 2010 15:16 UTC linuxfr.org [Source type: Academic]

^ Gosling's goals were to implement a virtual machine and a language that had a familiar C-like notation but with greater uniformity and simplicity than C/C++.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ The Java SE specification defines a wide range of general purpose APIs and also includes the Java Language Specification and the Java Virtual Machine Specification.
  • The Java Community Process(SM) Program - JSRs: Java Specification Requests - detail JSR# 270 10 January 2010 20:48 UTC jcp.org [Source type: FILTERED WITH BAYES]

[13]
.Sun Microsystems released the first public implementation as Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA), providing no-cost run-times on popular platforms.^ What platforms does Java run on?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Java ME (and Java in general) is write once, run anywhere.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ The first public implementation was Java 1.0 in 1995.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

.Fairly secure and featuring configurable security, it allowed network- and file-access restrictions.^ It was fairly secure and its security was configurable, allowing for network and file access to be limited.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Features: Load PDF documents from files, network drives, URLs or input streams; Extract text; Extract words as a vector of Strings Written entirely in Java-allows your application to remain platform independent.
  • Java Applets : A large collection of Java Applets 10 January 2010 20:48 UTC www.bigwebmaster.com [Source type: Reference]

^ Even more importantly Java was designed from the ground up to allow for secure execution of code across a network, even when the source of that code was untrusted and possibly malicious.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.Major web browsers soon incorporated the ability to run Java applets within web pages, and Java quickly became popular.^ Running a Java applet on Strauss.
  • Unix program: Java 10 January 2010 20:48 UTC www.udel.edu [Source type: FILTERED WITH BAYES]

^ An applet is a Java object designed to be in embedded in a web page.
  • Unix program: Java 10 January 2010 20:48 UTC www.udel.edu [Source type: FILTERED WITH BAYES]

^ How do I use a Java applet in a Web page?
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

.With the advent of Java 2 (released initially as J2SE 1.2 in December 1998), new versions had multiple configurations built for different types of platforms.^ The next version of the Java platform was just released as Java 5 with many enhancements.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ To bear out the difficulty of doing a new platform release: At this point, to my knowledge, BEA is the only one of the market leaders, to be Java EE certified, although the Java EE 5 specification has been final for months.
  • Java EE 6 Gets it Right | SpringSource Team Blog 10 January 2010 20:48 UTC blog.springsource.com [Source type: FILTERED WITH BAYES]

^ And nicely enough, the editor is built in cross-platform Java, which I think makes a whole lot of sense.

.For example, J2EE targeted enterprise applications and the greatly stripped-down version J2ME for mobile applications.^ For some example mobile applications: .
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ Outside of its server space success, Sun has pushed Java as an ideal platform for mobile devices using a stripped down micro edition called Java ME (formerly J2ME, and distinguished from the desktop Java SE standard edition and server Java EE enterprise edition).
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ Developer.com) • Stereotype Annotations Cut Down XML Configuration in Spring Spring stereotype annotations can greatly reduce the amount of XML configuration required to build and maintain a Spring application.
  • DevX: Java Zone 10 January 2010 20:48 UTC www.devx.com [Source type: General]

.J2SE designated the Standard Edition.^ The Java 2 Platform, Standard Edition ("J2SE") is the core Java platform for desktop and server environments.
  • The Java Community Process(SM) Program - JSRs: Java Specification Requests - detail JSR# 270 10 January 2010 20:48 UTC jcp.org [Source type: FILTERED WITH BAYES]

^ Java runtime and compiler components are available for download from Sun Microsystems; they are packaged in the Java 2 Platform Standard Edition (J2SE).
  • http://www.stylusstudio.com/configure_jre.html 10 January 2010 20:48 UTC www.stylusstudio.com [Source type: Reference]

.In 2006, for marketing purposes, Sun renamed new J2 versions as Java EE, Java ME, and Java SE, respectively.^ What's the latest news in the Java market, and why?
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ Because of this popularity, Sun created different varieties of Java for different purposes, including Java SE for home computers, Java ME for embedded devices, and Java EE for Internet servers and supercomputers .
  • Java (computer programming language) -- Britannica Online Encyclopedia 10 January 2010 20:48 UTC www.britannica.com [Source type: Reference]

^ I'm talking about the stock, Sun Microsystems is down 20% in the futures market @ 8:10 AM ET. -20% On the news of the $7 billion game of brinksmanship, it is important to...
  • ONJava.com: The Independent Source for Enterprise Java -- java development, open and emerging enterp 10 January 2010 20:48 UTC onjava.com [Source type: General]

.In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process.^ Disclaimer: Java is a trademark of Sun Microsystems.

^ Java is developed and maintained by Sun Microsystems .
  • Using the Java plugin with Firefox 10 January 2010 20:48 UTC support.mozilla.com [Source type: General]

^ Java is developed by sun microsystems.
  • Old Version of Java Download - OldApps.com 10 January 2010 20:48 UTC www.oldapps.com [Source type: General]

[14] .Java remains a de facto standard, controlled through the Java Community Process.^ Java remains a proprietary de facto standard that is controlled through the Java Community Process.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ In 1997, Sun approached the ISO/IEC JTC1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Now that Oracle is absorbing Sun Microsystems, there mixed views on what should come of the Java Community Process (JCP).
  • TheServerSide.com: your java Community discussing server side development 10 January 2010 20:48 UTC www.theserverside.com [Source type: General]

[15] .At one time, Sun made most of its Java implementations available without charge, despite their proprietary software status.^ (I am a software engineer and use Java most of the time.
  • "Java Is Dead, Long Live Java!" – The Future of Java | JAVA Developer's Journal 10 January 2010 20:48 UTC java.sys-con.com [Source type: General]

^ Sun has made the Java Developers Kit available for its supported platforms.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Sun's implementation of Java is nonfree.
  • Free but Shackled - The Java Trap 10 January 2010 20:48 UTC www.gnu.org [Source type: FILTERED WITH BAYES]

.Sun generated revenue from Java through the selling of licenses for specialized products such as the Java Enterprise System.^ Sun makes most of its Java implementations available without charge, with revenue being generated by specialized products such as the Java Enterprise System.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Almost all major operating system developers (IBM, Microsoft, and others) have added Java compilers as part of their product offerings.
  • What is Java? - Definition from Whatis.com 10 January 2010 20:48 UTC searchsoa.techtarget.com [Source type: FILTERED WITH BAYES]

^ Although Java allows sequential procedures, it shares with C++ an ability to "morph" abstract general objects into useful special cases.
  • JAVA FOR DERIVATIVES 10 January 2010 20:48 UTC www.margrabe.com [Source type: FILTERED WITH BAYES]

.Sun distinguishes between its Software Development Kit (SDK) and Runtime Environment (JRE) (a subset of the SDK); the primary distinction involves the JRE's lack of the compiler, utility programs, and header files.^ Sun distinguishes between its Software Development Kit (SDK) and Runtime Environment (JRE) which is a subset of the SDK, the primary distinction being that in the JRE the compiler is not present.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ A plethora of Ruby tools are being developed as open source software: compilers, test runners, integrated development environments, and bindings to graphical user interface toolkits written in other languages.
  • Ruby (programming language) - encyclopedia article - Citizendium 2 February 2010 15:16 UTC locke.citizendium.org [Source type: FILTERED WITH BAYES]

^ The Java programming language, created by Sun, was designed to allow programmers to write software on one platform and run it on another.
  • Java Code, Java Design, Java Tools, Java Info 10 January 2010 20:48 UTC www.devarticles.com [Source type: General]

.On November 13, 2006, Sun released much of Java as open source software under the terms of the GNU General Public License (GPL).^ You should have received a copy of the GNU General Public License .
  • The Python Papers, Volume 2, Issue 2 2 February 2010 15:16 UTC archive.pythonpapers.org [Source type: FILTERED WITH BAYES]

^ GNU General Public License as published by .
  • The Python Papers, Volume 2, Issue 2 2 February 2010 15:16 UTC archive.pythonpapers.org [Source type: FILTERED WITH BAYES]

^ Open source; written in Java.
  • Java Integrated Development Environments (IDEs) and Editors 10 January 2010 20:48 UTC www.apl.jhu.edu [Source type: FILTERED WITH BAYES]

.On May 8, 2007, Sun finished the process, making all of Java's core code available under free software/open-source distribution terms, aside from a small portion of code to which Sun did not hold the copyright.^ Edit: The source code is available here .
  • Elie El Khoury » Java ★ 10 January 2010 20:48 UTC www.ekhoury.com [Source type: General]

^ Apache Lucene is an open source project available for free download .
  • Apache Lucene - Overview 10 January 2010 20:48 UTC lucene.apache.org [Source type: General]

^ All distributions contain documentation and source code.
  • Java+ Preprocessor Release 2.0 10 January 2010 20:48 UTC virtualschool.edu [Source type: Reference]

[16]
.Sun's vice-president Rich Green has said that Sun's ideal role with regards to Java is as an "evangelist."^ Google's chief of open source believes an IBM acquisition of Sun could benefit the Java community, which has occasionally protested Sun's leadership role over the technology.

^ Patrick Naughton, then of Sun, now vice-president of technology at StarWave, started the Green Project on December 5th, 1990.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ "I vehemently disagree," says John Loiacono, executive vice-president of Sun's software division.

[17]

Principles

There were five primary goals in the creation of the Java language:[18]
  1. It should be "simple, object oriented, and familiar".
  2. It should be "robust and secure".
  3. It should be "architecture neutral and portable".
  4. It should execute with "high performance".
  5. It should be "interpreted, threaded, and dynamic".

Practices

Java Platform

.One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any supported hardware/operating-system platform.^ The major characteristics of Java are: The programs you create are portable in a network.
  • What is Java? - Definition from Whatis.com 10 January 2010 20:48 UTC searchsoa.techtarget.com [Source type: FILTERED WITH BAYES]

^ Platform independence The second characteristic, platform independence, means that programs written in the Java language must run similarly on diverse hardware.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ What platforms does Java run on?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code.^ Java compiles to an object code for a theoretical machine; the Java interpreter emulates that machine.
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

^ This is achieved by most Java compilers by compiling the Java language code "halfway" to bytecode (specifically Java bytecode)—simplified machine instructions specific to the Java platform.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Java applications are typically compiled to bytecode , although compilation to native machine code is also possible.
  • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

.Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware.^ Java compiles to an object code for a theoretical machine; the Java interpreter emulates that machine.
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

^ Java bytecodes are translated on the fly to native machine instructions (interpreted) and not stored anywhere.
  • The Java(tm) Language: An Overview 10 January 2010 20:48 UTC java.sun.com [Source type: FILTERED WITH BAYES]

^ The code is then run on a virtual machine (VM), a program written in native code on the host hardware that interprets and executes generic Java bytecode.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

.End-users commonly use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets.^ We use Java Web Start technology rather than Java Applets.
  • Troubleshooting Java 10 January 2010 20:48 UTC phet.colorado.edu [Source type: General]

^ Both of the major Web browsers include a Java virtual machine.
  • What is Java? - Definition from Whatis.com 10 January 2010 20:48 UTC searchsoa.techtarget.com [Source type: FILTERED WITH BAYES]

^ How do I use a Java applet in a Web page?
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

.Standardized libraries provide a generic way to access host-specific features such as graphics, threading and networking.^ Further, standardized libraries are provided to allow access to features of the host machines (such as graphics, threading and networking) in unified ways.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Some open source communities want to help ease the reuse problem, by providing authors with ways to disseminate information about generally reusable objects and object libraries.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ This edition introduces new features added to the Java platform since the publication of the third edition (under release 1.3), such as a chapter on Generics and information on annotations.
  • CodeIdol - Thinking about Java 10 January 2010 20:48 UTC codeidol.com [Source type: FILTERED WITH BAYES]

A major benefit of using bytecode is porting. .However, the overhead of interpretation means that interpreted programs almost always run more slowly than programs compiled to native executables would, and Java suffered a reputation for poor performance.^ Netscape 2.0 can even compile Java programs.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ The tradeoff is in performance: the interpreter adds a significant level of overhead to the program.
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

^ It compiles down to native code then runs the native code.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

.This gap has been narrowed by a number of optimization techniques introduced in the more recent JVM implementations.^ The new 2.2 version of GlassFish ESB introduces new tools to implement some of the more complex ...
  • Java Articles, Posts, Blogs, Videos - Technorati 10 January 2010 20:48 UTC technorati.com [Source type: General]

^ More recent JVM implementations produce programs that run significantly faster than before, using multiple techniques.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

Implementations

.Sun Microsystems officially licenses the Java Standard Edition platform for Linux,[19] Mac OS X,[20] and Solaris.^ Java was created at Sun Microsystems, Inc.
  • Java (computer programming language) -- Britannica Online Encyclopedia 10 January 2010 20:48 UTC www.britannica.com [Source type: Reference]

^ Java is developed and maintained by Sun Microsystems .
  • Using the Java plugin with Firefox 10 January 2010 20:48 UTC support.mozilla.com [Source type: General]

^ Java_%28programming_language%29#Implementations -- "Sun sued in 1997, and in 2001 won a settlement of $20 million as well as a court order enforcing the terms of the license from Sun.
  • » Windows XP se stále prodávají více než Vista - Petr Krčmář: blog nejen o Linuxu 2 February 2010 15:16 UTC petrkrcmar.blog.root.cz [Source type: Academic]

.Although in the past Sun has licensed Java to Microsoft, the license has expired and has not been renewed.^ Using C# with platform libraries is trivial, whereas with Java it is a bit of a pain (although maybe in the past few years Java might have made advances in that area).
  • strchr.com 2 February 2010 15:16 UTC www.strchr.com [Source type: FILTERED WITH BAYES]
  • strchr.com 2 February 2010 15:16 UTC www.strchr.com [Source type: FILTERED WITH BAYES]

^ In part, this was because Apple didn’t partner with Microsoft or delegate it control of the QuickTime implementation on Windows in the way Sun foolishly did with Java.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ The Restricted Formats page contains installation directions for the Sun Java distributions that are encumbered by non open source licenses.
  • Java - OLPC 10 January 2010 20:48 UTC wiki.laptop.org [Source type: FILTERED WITH BAYES]

[21] .Through a network of third-party vendors and licensees,[22] alternative Java environments are available for these and other platforms.^ What other Java Resources are available?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Others provide alternatives to platform facilities.
  • Java EE 6 Gets it Right | SpringSource Team Blog 10 January 2010 20:48 UTC blog.springsource.com [Source type: FILTERED WITH BAYES]

^ South Florida Software and Electronics Engineers The purpose of this group is to provide a forum for learning and improving software and electronics engineering skills as well as to network with other professionals in these fields.
  • Java Meetup Groups - Java Meetups 10 January 2010 20:48 UTC java.meetup.com [Source type: General]

.Sun's trademark license for usage of the Java brand insists that all implementations be "compatible". This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support RMI or JNI and had added platform-specific features of their own.^ Java compatibility is a feature that any browser can implement and by so doing implement every feature!
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Sun's license for Java insists that all implementations be "compatible".
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support the RMI and JNI interfaces and had added platform-specific features of their own.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

.Sun sued in 1997, and in 2001 won a settlement of $20 million as well as a court order enforcing the terms of the license from Sun.^ Java_%28programming_language%29#Implementations -- "Sun sued in 1997, and in 2001 won a settlement of $20 million as well as a court order enforcing the terms of the license from Sun.
  • » Windows XP se stále prodávají více než Vista - Petr Krčmář: blog nejen o Linuxu 2 February 2010 15:16 UTC petrkrcmar.blog.root.cz [Source type: Academic]

[23] .As a result, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a third-party plugin.^ In response, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a third-party plug-in.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ There is no support for versioning classes in Java 1.0.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ And here's the result of a Java applet : .
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

.Sun, and others, have made available free Java run-time systems for those and other versions of Windows.^ What other Java Resources are available?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ However, Sun and others have made available Java run-time systems at no cost for those and other versions of Windows.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Sun has made the Java Developers Kit available for its supported platforms.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Platform-independent Java is essential to the Java EE strategy, and an even more rigorous validation is required to certify an implementation.^ Java is platform independent.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Platform independence The second characteristic, platform independence, means that programs written in the Java language must run similarly on diverse hardware.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ The aim of the Java EE 5 platform is to provide developers a powerful set of APIs while reducing development time, reducing application complexity, and improving application performance.
  • CodeIdol - Thinking about Java 10 January 2010 20:48 UTC codeidol.com [Source type: FILTERED WITH BAYES]

.This environment enables portable server-side applications, such as Web services, Java Servlets, and Enterprise JavaBeans, as well as with embedded systems based on OSGi, using Embedded Java environments.^ DataML DataML is a web server extension that can be integrated into any JAVA enabled web server.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ People are most familiar with Java used in server side enterprise systems or applets.
  • Java Articles, Posts, Blogs, Videos - Technorati 10 January 2010 20:48 UTC technorati.com [Source type: General]

^ Platform-independent Java is however very successful with server-side applications, such as Web services, servlets , and Enterprise JavaBeans, as well as with Embedded systems based on OSGi, using Embedded Java environments.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

.Through the new GlassFish project, Sun is working to create a fully functional, unified open source implementation of the Java EE technologies.^ Open source; written in Java.
  • Java Integrated Development Environments (IDEs) and Editors 10 January 2010 20:48 UTC www.apl.jhu.edu [Source type: FILTERED WITH BAYES]

^ Developers split on open sourcing Java .
  • TheServerSide.com: your java Community discussing server side development 10 January 2010 20:48 UTC www.theserverside.com [Source type: General]

^ Ability to work with Glassfish sources, and build it from source.
  • Gentoo Linux Projects-- The Java Project 10 January 2010 20:48 UTC www.gentoo.org [Source type: FILTERED WITH BAYES]

.Sun also distributes a superset of the JRE called the Java Development Kit (commonly known as the JDK), which includes development tools such as the Java compiler, Javadoc, Jar and debugger.^ This article does not cover the installation of the Java Development Kit (JDK).
  • Java Tutorials 10 January 2010 20:48 UTC www.vogella.de [Source type: Reference]

^ Sun also distributes a superset of the JRE called the Java 2 SDK (more commonly known as the JDK), which includes development tools such as the Java compiler, Javadoc, and debugger.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Java is developed and maintained by Sun Microsystems .
  • Using the Java plugin with Firefox 10 January 2010 20:48 UTC support.mozilla.com [Source type: General]

Performance

.Programs written in Java have a reputation for being slower and requiring more memory than those written in some other languages.^ Where Java is more portable than other languages is in its object code.
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

^ In a number of ways, Java is a more dynamic language than C or C++.
  • The Java(tm) Language: An Overview 10 January 2010 20:48 UTC java.sun.com [Source type: FILTERED WITH BAYES]

^ Java is a programming language for distributed applications.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

[24] .However, Java programs' execution speed improved significantly with the introduction of Just-in-time compilation in 1997/1998 for Java 1.1,[25][26][27] the addition of language features supporting better code analysis (such as inner classes, StringBuffer class, optional assertions, etc.^ High Performance Java can be compiled on the fly with a Just-In-Time compiler (JIT) to code that rivals C++ in speed.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ This is purely a convention and not a feature of the Java language.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Java is a programming language for distributed applications.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

), and optimizations in the Java Virtual Machine itself, such as HotSpot becoming the default for Sun's JVM in 2000.
.To boost even further the speed performances that can be achieved using the Java language Systronix made JStik[28], a microcontroller based on the aJile Systems[29] line of embedded Java processors.^ Companies and individuals with challenging programming problems increasingly embrace the language and platform, and the question faced by those who do not use Java is often when they will start, not if.
  • CodeIdol - Thinking about Java 10 January 2010 20:48 UTC codeidol.com [Source type: FILTERED WITH BAYES]

^ Also, if you're serious about this, I can learn LUA (I learn coding like...a week per language, TOPS. Even learned Java in a week :@ ) and help with coding.
  • Operation: Assassination [Archive] - Fun-Motion Physics Games Forum 2 February 2010 15:16 UTC www.fun-motion.com [Source type: General]

^ It requires GC, which is usually the right choice, but not when you are dealing with a class of languages that are typically used to write kernels and do embedded programming.

Automatic memory management

.Java uses an automatic garbage collector to manage memory in the object lifecycle.^ Current implementations of Java use a mark and sweep garbage collector.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ What is the purpose of garbage collection in Java, and when is it used?
  • Java Interview Questions 10 January 2010 20:48 UTC www.allapplabs.com [Source type: Reference]

^ By virtue of having automatic garbage collection (periodic freeing of memory not being referenced) the Java language not only makes the programming task easier, it also dramatically cuts down on bugs.
  • The Java(tm) Language: An Overview 10 January 2010 20:48 UTC java.sun.com [Source type: FILTERED WITH BAYES]

.The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use.^ The programmer determines when objects are created, and the Java runtime is responsible for managing the object's lifecycle.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ As a result, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a third-party plugin."
  • » Windows XP se stále prodávají více než Vista - Petr Krčmář: blog nejen o Linuxu 2 February 2010 15:16 UTC petrkrcmar.blog.root.cz [Source type: Academic]

^ The order of evaluation (ignoring out of memory problems) when you say new C() is: Call a constructor for C's superclass (unless C is Object , in which case it has no superclass).
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

.Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector.^ When no references to an object remain, the Java garbage collector automatically deletes the unreachable object, freeing memory and preventing a memory leak.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ The order of evaluation (ignoring out of memory problems) when you say new C() is: Call a constructor for C's superclass (unless C is Object , in which case it has no superclass).
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ This generates the heading, then refers to another partial, which will be used once for each object in the collection named tags .
  • The Python Papers, Volume 2, Issue 2 2 February 2010 15:16 UTC archive.pythonpapers.org [Source type: FILTERED WITH BAYES]

.Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use.^ At the level of machine code in the CPU a reference is an address in memory where the address of the object is stored.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ A. Use object pooling and weak object references.
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ No doubt other people have still different memories of what occurred.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.If methods for a nonexistent object are called, a "null pointer exception" is thrown.^ In other words, you call a method on an object, and you get back an object (possibly a new one).
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ To make a link to edit the blog, we call the method [term]edit blog path[/term] and specify the argument, which again can either be the blog object or the blog id, like this [term]edit blog path(blog)[/term] or [term]edit blog path(blog.id)[/term].
  • The Life Of A Radar » 2007 » September 2 February 2010 15:16 UTC ryanbigg.com [Source type: General]

^ But clients manually deallocate objects by calling a method that places the object carcass in a pool, from where it can be reallocated when needed.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

[30][31]
.One of the ideas behind Java's automatic memory management model is that programmers be spared the burden of having to perform manual memory management.^ Automatic garbage collection One idea behind Java's automatic memory management model is that programmers should be spared the burden of having to perform manual memory management.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Comparing Java and C++, it is possible in C++ to implement similar functionality (for example, a memory management model for specific classes can be designed in C++ to improve speed and lower memory fragmentation considerably), with the possible cost of extra development time and some application complexity.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ One such example of half-truths is Edward Yourdon's Java and the new Internet programming paradigm from Rise and Resurrection of the American Programmer [footnote on Yourdon] .
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

.In some languages memory for the creation of objects is implicitly allocated on the stack, or explicitly allocated and deallocated from the heap.^ Allocates some memory from this session’s memory pool.
  • Platform Selection - Our Agile Dev Processes - Wiki.Directi 2 February 2010 15:16 UTC wiki.directi.com [Source type: FILTERED WITH BAYES]

^ In some languages the programmer allocates memory to create any object stored on the heap and is responsible for later manually deallocating that memory to delete any such objects.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ It allocates memory from the heap.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

.Either way, the responsibility of managing memory resides with the programmer.^ Having to carefully manage the memory changes the way you think.
  • The Joel on Software Discussion Group - What is the "point" of POINTERS? 2 February 2010 15:16 UTC discuss.joelonsoftware.com [Source type: FILTERED WITH BAYES]

^ In some languages the programmer allocates memory to create any object stored on the heap and is responsible for later manually deallocating that memory to delete any such objects.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ Automatic garbage collection One idea behind Java's automatic memory management model is that programmers should be spared the burden of having to perform manual memory management.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

.If the program does not deallocate an object, a memory leak occurs.^ I thought programs written in C/C++ are more likely to have security holes because programmers need to allocate/deallocate dynamic memory manually.

^ Does garbage collection guarantee that a program will not run out of memory?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ The garbage collector usually does a pretty good job of reclaiming storage, but in rare cases it may be more efficient to allocate/deallocate objects manually.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

.If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined and difficult to predict, and the program is likely to become unstable and/or crash.^ In addition, if a region of memory is deallocated twice, the program can become unstable and may crash.
  • History of Java programming language | www.freejavaguide.com 10 January 2010 20:48 UTC www.freejavaguide.com [Source type: Reference]

^ This would of course be a very bad thing, and is likely to result in a crash as soon as the plugin is loaded or the information schema table is accessed.
  • Platform Selection - Our Agile Dev Processes - Wiki.Directi 2 February 2010 15:16 UTC wiki.directi.com [Source type: FILTERED WITH BAYES]

^ Java programs cannot (at least in theory) access arbitrary addresses in memory.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.This can be partially remedied by the use of smart pointers, but these add overhead and complexity.^ Both new and malloc return a pointer, so almost any reasonably complex C or C++ program will use pointers for that reason, if nothing else.
  • The Joel on Software Discussion Group - What is the "point" of POINTERS? 2 February 2010 15:16 UTC discuss.joelonsoftware.com [Source type: FILTERED WITH BAYES]

^ Of course you'll need to adjust this to match where you've installed these files and to add any other classes you use.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Either technique will add complexity and overhead to the Java run time environment.
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

Note that garbage collection does not prevent 'logical' memory leaks, i.e. those where the memory is still referenced but never used.
.Garbage collection may happen at any time.^ What the garbage collection scheme causes is that the process will consume more memory than it really needs (in pathological cases it can consume even hundreds of times more memory than it really is using).
  • Why I hate Java 10 January 2010 20:48 UTC warp.povusers.org [Source type: FILTERED WITH BAYES]

^ Again, the real-time Java spec provides for the existence of memory areas other than the garbage-collected heap.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ Java has garbage collection and no destructors, so there needs to be some way to ensure that certain things happen before exiting the scope.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

Ideally, it will occur when a program is idle. .It is guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new object; this can cause a program to stall momentarily.^ In Java all objects are allocated on the heap.
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ There is no need to explicitly allocate or free memory in Java.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ It allocates memory from the heap.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

.Explicit memory management is not possible in Java.^ There's a good reason why C++ is still in wide and very popular use: precisely because it does have explicit memory management and pointer arithmetic.
  • Google's Go; a new, open-source programming language - Computerworld Blogs 2 February 2010 15:16 UTC blogs.computerworld.com [Source type: General]

^ 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.
  • The Java(tm) Language: An Overview 10 January 2010 20:48 UTC java.sun.com [Source type: FILTERED WITH BAYES]

^ If the language makes all boundary controls, memory managements then this language will be slow like java :) My attitude is that C is as safety as another programming language.
  • Is C a vitamin? at Özgür Macit 2 February 2010 15:16 UTC www.ozgurmacit.com [Source type: FILTERED WITH BAYES]

.Java does not support C/C++ style pointer arithmetic, where object addresses and unsigned integers (usually long integers) can be used interchangeably.^ What fonts does Java support?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Why Java does not support pointers?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ Does Java have pointers?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.This allows the garbage collector to relocate referenced objects, and ensures type safety and security.^ The garbage collector usually does a pretty good job of reclaiming storage, but in rare cases it may be more efficient to allocate/deallocate objects manually.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ Should one pool objects to help Garbage Collector?Should one call System.gc() periodically?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ Now the method invoked by entry.equals(key) depends upon the actual run-time type of the object referenced by entry , and the declared, compile-time type of the variable key .
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

.As in C++ and some other object-oriented languages, variables of Java's primitive data types are not objects.^ Where Java is more portable than other languages is in its object code.
  • Making Sense of Java 10 January 2010 20:48 UTC disordered.org [Source type: FILTERED WITH BAYES]

^ Only objects and primitive data types can be passed to methods.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Summary of primitive data types .
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.Values of primitive types are either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap, as commonly true for objects (but see Escape analysis).^ A boolean is a value that is either true or false.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Only objects and primitive data types can be passed to methods.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ C for the equals method with argument of type Object .
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

This was a conscious decision by Java's designers for performance reasons. .Because of this, Java was not considered to be a pure object-oriented programming language.^ Java makes programming easier because it is object-oriented and has automatic garbage collection.
  • The Java(tm) Language: An Overview 10 January 2010 20:48 UTC java.sun.com [Source type: FILTERED WITH BAYES]

^ Java, formerly known as oak, is an object-oriented programming language developed by Sun.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Java is a programming language for distributed applications.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.However, as of Java 5.0, autoboxing enables programmers to proceed as if primitive types are instances of their wrapper classes.^ Strings are not a primitive type, but are instances of the String class.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Strings are a reference or object type , that is a instances of the class java.lang.String .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Primitive float type and wrapper class float have different comparison behavior .
  • Java theory and practice: Where's your point? 10 January 2010 20:48 UTC www.ibm.com [Source type: FILTERED WITH BAYES]

Syntax

.The syntax of Java is largely derived from C++.^ The language derives much of its syntax from C and C++ but has a simpler object model JavaScript , a scripting language , shares a similar name and has similar syntax, but is not directly related to Java.
  • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

^ In the small it looks like C. The syntax of Java is deliberately similar to C. If you know C you already know large chunks of Java.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.Unlike C++, which combines the syntax for structured, generic, and object-oriented programming, Java was built almost exclusively as an object oriented language.^ This is not good object-oriented programming.
  • Why I hate Java 10 January 2010 20:48 UTC warp.povusers.org [Source type: FILTERED WITH BAYES]

^ Object Oriented Programming is the programming buzzword of the 90's.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Java is the latest and possibly the greatest third generation programming language.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.All code is written inside a class and everything is an object, with the exception of the intrinsic data types (ordinal and real numbers, boolean values, and characters), which are not classes for performance reasons.^ A class defines what data can be in an object, and what operations are performed by the methods.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ (Yes, lisp code can be data, but not all lisp data is code.
  • Hacker News | Why Lisp Is Unpopular 2 February 2010 15:16 UTC news.ycombinator.com [Source type: Original source]

^ The values can be Strings as in this example, numbers, objects or any other kind of Java data type.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Java suppresses several features (such as operator overloading and multiple inheritance) for classes in order to simplify the language and to prevent possible errors and anti-pattern design.^ Therefore Java's designers elected not to add this feature to the language.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Java does not support multiple inheritance.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Two classes of language features have been removed from C++ to make it Java.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.Java uses similar commenting methods to C++.^ Java programs communicate with their methods using pass-by-value.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Java Tip: Simplify Spring Apps with @Autowired @Autowired is not just for property injection, but also can be used in methods and constructors.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ Static factory methods are used throughout the Java libraries.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

.There are three different styles of comment: a single line style marked with two forward slashes (//), a multiple line style opened with a forward slash asterisk (/*) and closed with an asterisk forward slash (*/) and the Javadoc commenting style opened with a forward slash and two asterisks (/**) and closed with an asterisk forward slash (*/).^ There are three comment styles in Java.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ There are at least three different ways to do this.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ But there were some blurred lines and the intensive research shops with great industry contacts could get an ever-so-slight heads up that could make a difference.

.The Javadoc style of commenting allows the user to run the Javadoc executable to compile documentation for the program.^ It turns out these are virtually the same requirements for allowing people to download and run programs from the Web.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ PS - If you are worried about "compile time type checking", I think it's > prudent to mention now that Clojure is a dynamically typed programming > language where types are checked at run-time and not compile time.
  • Clojure newbie question regarding compile time type checking. - Clojure | Google Groups 2 February 2010 15:16 UTC groups.google.com [Source type: FILTERED WITH BAYES]

^ Object oriented programming allows the user to reuse existing code rather than rewrite it.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

Example:
.
//This is an example of a single line comment using two forward slashes
 
/* This is an example of a multiple line comment using the forward slash
   and asterisk.^ Python and Ruby lines of code were measured using David A Wheeler's “sloccount” tool [WHEELER], which ignores blank lines and comments.
  • The Python Papers, Volume 2, Issue 2 2 February 2010 15:16 UTC archive.pythonpapers.org [Source type: FILTERED WITH BAYES]

^ For a classic example in a Stack , prefer having two methods Object top() and void removeTop() versus the single method Object pop() that does both.
  • Draft Java Coding Standard 10 January 2010 20:48 UTC g.oswego.edu [Source type: Reference]

^ Using Caramba makes it possible to make fancy, responsive web-applications without having to write a single line of JavaScript.
  • Open Source Web Frameworks in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

.This type of comment can be used to hold a lot of information or deactivate code but it is very important to remember to close the comment.^ It's very unlikely that we'll ever receive useful information from PortalPlayer/NVidia in my personal opinion.
  • #rockbox 2007-04-04 2 February 2010 15:16 UTC www.rockbox.org [Source type: General]

^ The Pascal standard was truly a harsh mistress, and turbo pascal made a lot of very useful engineering choices to make a fast, very useful compiler in a small environment.
  • Hacker News | I'm turning into a Lisp snob 2 February 2010 15:16 UTC news.ycombinator.com [Source type: Original source]

^ Programmers spend a lot more time reading code than writing it, and it's hard to read code that doesn't use the right abstractions.
  • Hacker News | Why Lisp Is Unpopular 2 February 2010 15:16 UTC news.ycombinator.com [Source type: Original source]

*/

Examples

Hello world

The traditional Hello world program can be written in Java as:
// Outputs "Hello, world!" and then exits
.public class HelloWorld {
   public static void main(String args[]) {
       System.^ Why main method of Java has public static void?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ MyApplication { public static void main(String[] args) { /* Need an instance of class Particle - a particle object; assign it to the variable a which is of type Particle.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Personally I’m against using “kiddie” programming languages, but can understand why you wouldn’t want to jump into “public static void main(String[] args)” Java or other high level languages.
  • » Teaching kids, part 1 - DevChix - Blog Archive 2 February 2010 15:16 UTC www.devchix.com [Source type: General]

out.println("Hello, world!"); } }
.Source files must be named after the public class they contain, appending the suffix .java, for example, HelloWorld.java.^ "HelloWorld" documentation java class shows: .
  • John Resig - Running Java in JavaScript 10 January 2010 20:48 UTC ejohn.org [Source type: General]

^ The java compiler enforces the convention that file names have the same base name as the public class they define.
  • Draft Java Coding Standard 10 January 2010 20:48 UTC g.oswego.edu [Source type: Reference]

^ The name of the file should be the same as the name of the class, for example, MyApplication.java.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.It must first be compiled into bytecode, using a Java compiler, producing a file named HelloWorld.class.^ "HelloWorld" documentation java class shows: .
  • John Resig - Running Java in JavaScript 10 January 2010 20:48 UTC ejohn.org [Source type: General]

^ The name of the file should be the same as the name of the class, for example, MyApplication.java.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ You still also have to use CODE to give name of the .class file.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Only then can it be executed, or 'launched'. The java source file may only contain one public class but can contain multiple classes with less than public access and any number of public inner classes.^ No file should contain more than one public class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Or you may need access to multiple files simultaneously.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ So, one column can contain multiple values, and each is associated to one of the storage classes.
  • Platform Selection - Our Agile Dev Processes - Wiki.Directi 2 February 2010 15:16 UTC wiki.directi.com [Source type: FILTERED WITH BAYES]

.A class that is not declared public may be stored in any .java file.^ Thus if it wants the java.awt.GridBagLayout class, it looks for the file java/awt/GridBagLayout.class in each of the root directories listed in the CLASSPATH variable from left to right until it finds the file.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Source code files should be stored in the same directory as their compiled .class file.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ No file should contain more than one public class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.The compiler will generate a class file for each class defined in the source file.^ Compiling the plugin source file .
  • Platform Selection - Our Agile Dev Processes - Wiki.Directi 2 February 2010 15:16 UTC wiki.directi.com [Source type: FILTERED WITH BAYES]

^ When you attach a file, a tiddler (tagged with < > ) is generated (using the source filename as the tiddler's title).
  • TiddlyFolio - Your Wiki Wallet v0.98b beta for Firefox 2 February 2010 15:16 UTC tiddlyfolio.tiddlyspot.com [Source type: FILTERED WITH BAYES]

^ Source code files should be stored in the same directory as their compiled .class file.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.The name of the class file is the name of the class, with .class appended.^ For reasons we'll see later it's advisable to give the source code file the same name as the main class in the file plus the .java extension.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The java compiler enforces the convention that file names have the same base name as the public class they define.
  • Draft Java Coding Standard 10 January 2010 20:48 UTC g.oswego.edu [Source type: Reference]

^ All files should have the same name as their single public class followed by the extension ".java".
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.For class file generation, anonymous classes are treated as if their name was the concatenation of the name of their enclosing class, a $, and an integer.^ The limitation of having a fixed set of methods, and thus components, is overcome in Swing by using a mapping from a generic UI component name (such as "ButtonUI") to the name of an implementing class.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ For reasons we'll see later it's advisable to give the source code file the same name as the main class in the file plus the .java extension.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The name Report Program Generator was descriptive of the purpose of the language: generation of reports from data files, including matching record and sub-total reports.
  • RPG Programming, Development, RPG Software Development Directory, Links,RPG Programmer, Programmers, Developer, Developers 2 February 2010 15:16 UTC www.mainframes.in [Source type: Reference]

.The keyword public denotes that a method can be called from code in other classes, or that a class may be used by classes outside the class hierarchy.^ We also add other useful methods.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Q: When should I use constructors, and when should I use other methods?
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ In interpreted code we're getting about 300,000 method calls per second on an Sun Microsystems SPARCStation 10.
  • The Java(tm) Language: An Overview 10 January 2010 20:48 UTC java.sun.com [Source type: FILTERED WITH BAYES]

.The class hierarchy is related to the name of the directory in which the .java file is.^ This file must be in your classes directory.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The name of the file should be the same as the name of the class, for example, MyApplication.java.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Forcing a class to be contained in a file having the same name as the class is not so bad, but requiring a directory structure to match a package hierarchy is SOOOOO LAME! Java is also exception crazy, and its fondness for exceptions was imitated by C#.
  • strchr.com 2 February 2010 15:16 UTC www.strchr.com [Source type: FILTERED WITH BAYES]
  • strchr.com 2 February 2010 15:16 UTC www.strchr.com [Source type: FILTERED WITH BAYES]

.The keyword static in front of a method indicates a static method, which is associated only with the class and not with any specific instance of that class.^ Methods can be created only as part of a class.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Static variables and methods are instantiated only once per class.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ An object is a specific instance of a class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Only static methods can be invoked without a reference to an object.^ For example, Runtime 's static getRuntime method returns the virtual machine's Singleton Runtime object.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ Only objects and primitive data types can be passed to methods.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Can't make static reference to method type myMethod in class myClass .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.Static methods cannot access any method variables that are not static.^ Why a abstract method cannot be static?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ The default access specifier for the names of variables and methods is “package visibility” or “friendly,” which means that all the other classes in the current package have access to them.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Rationale: You cannot assume that non-private statics will be accessed only after instances are constructed.
  • Draft Java Coding Standard 10 January 2010 20:48 UTC g.oswego.edu [Source type: Reference]

.The keyword void indicates that the main method does not return any value to the caller.^ If the return type is void then no value will be returned.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The keyword return followed by an expression returns the value of the expression to the caller of the method.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ If no value is returned, the return-value-type is void .
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.If a Java program is to exit with an error code, it must call System.exit() explicitly.^ Real-Time Java Programming for the Rest of Us (09/23/09) Get a down-to-earth definition of real-time systems and their associated concepts from two of Sun's Java real-time programming experts.
  • DevX: Java Zone 10 January 2010 20:48 UTC www.devx.com [Source type: General]

^ The Java Preference API removes the burden from the individual programmer to write code to save configuration values on the different platforms his program may be running.
  • Java Tutorials 10 January 2010 20:48 UTC www.vogella.de [Source type: Reference]

^ Using Program Parameters in Java Each of us, as Java programmers will encounter situations where choices must be made between various coding solutions.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

.The method name "main" is not a keyword in the Java language.^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ If you have static block, constructor and main method in Java file then what will be the sequence of method calls?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ For reasons we'll see later it's advisable to give the source code file the same name as the main class in the file plus the .java extension.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.It is simply the name of the method the Java launcher calls to pass control to the program.^ Java programs communicate with their methods using pass-by-value.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ How is an argument passed in Java methods?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ Each calculation part of a program is called a method.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Java classes that run in managed environments such as applets and Enterprise JavaBean do not use or need a main() method.^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Add a main() method to the applet.
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ An applet is a Java class which extends java.applet.Applet .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.A java program may contain multiple classes that have main methods, which means that the VM needs to be explicitly told which class to launch from.^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ What does it mean that a method or class is abstract ?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Methods are not first class objects in Java.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.The main method must accept an array of String objects.^ Because a String variable is an object, it has methods.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Here, the annotation specifies that the getUsersAsJsonArray method returns a JSONArray object containing an array of URIs for all existing user resources.
  • Implementing RESTful Web Services in Java : Enterprise Tech Tips 10 January 2010 20:48 UTC blogs.sun.com [Source type: FILTERED WITH BAYES]

^ Yourdon also includes a number of minor typos, like saying that arrays have a length() method (instead of a length field) and that modifiable strings are represented by StringClass (instead of StringBuffer ).
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

.By convention, it is referenced as args although any other legal identifier name can be used.^ Naming conventions Standard ways to name identifiers (class names, method names, variable names, etc).
  • Draft Java Coding Standard 10 January 2010 20:48 UTC g.oswego.edu [Source type: Reference]

^ On the other hand if you're used to C you're probably upset because args[0] is the first command line argument instead of the command name.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ When you install the ASP.NET MVC Framework we automatically register this .mvc extension – although you are free to use any other one you want.
  • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

.Since Java 5, the main method can also use variable arguments, in the form of public static void main(String...^ Static factory methods are used throughout the Java libraries.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ Test using main method .

^ Why main method of Java has public static void?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

args)
, allowing the main method to be invoked with an arbitrary number of String arguments. .The effect of this alternate declaration is semantically identical (the args parameter is still an array of String objects), but allows an alternative syntax for creating and passing the array.^ An array object may be created and initialized when its reference is declared.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ All parameters are passed as Strings.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The most obvious difference is syntax: Java’s syntax is based on C++’ whereas Objective-C employs the C syntax (and semantics) with the syntax of object declaration and manipulation based on Smalltalk.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

.The Java launcher launches Java by loading a given class (specified on the command line or as an attribute in a JAR) and starting its public static void main(String[]) method.^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Why main method of Java has public static void?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ Methods are not first class objects in Java.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.Stand-alone programs must declare this method explicitly.^ More generally and less technically an application is a stand-alone program, normally launched from the command line, and which has more or less unrestricted access to the host system.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Instead you can declare an interface called Price with a price() method like this: public interface Price { public float price(); } Any class which implements the Price interface must contain a method with the signature public float price() .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ The type of this value must match the declared type of the method.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.The String[] args parameter is an array of String objects containing any arguments passed to the class.^ Finally we pass any command line arguments to the method in an array of Strings called args .
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ All parameters are passed as Strings.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Provides programming tips on a variety of topics including variables, arrays, and operators; conditionals and loops; object-oriented programming; inheritance and inner classes;… Read more.
  • Java - O'Reilly Media 10 January 2010 20:48 UTC oreilly.com [Source type: General]

.The parameters to main are often passed by means of a command line.^ The number of passes to make may also be entered from the command line.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Main methods in an application store the command line arguments in an array of strings called args .
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Finally we pass any command line arguments to the method in an array of Strings called args .
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Printing is part of a Java standard library: The System class defines a public static field called out.^ Java also has standard libraries for doing mathematics.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ The statement System.out.println() allows us to print the argument to the standard output with a call to the System class .
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ If you have static block, constructor and main method in Java file then what will be the sequence of method calls?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

.The out object is an instance of the PrintStream class and provides many methods for printing data to standard out, including println(String) which also appends a new line to the passed string.^ Strings are not a primitive type, but are instances of the String class.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ The class in that instance was of no importance; the METHOD was.
  • Coding Horror: Getting the Interview Phone Screen Right 2 February 2010 15:16 UTC www.codinghorror.com [Source type: Original source]

^ Only objects and primitive data types can be passed to methods.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.The string "Hello, world!"^ HelloWorld { public static void main (String args[]) { System.out.println("Hello World"); } } class GoodbyeWorld { public static void main (String args[]) { System.out.println("Goodbye Cruel World!"
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ String ( "Hello World" , 0 , getFontMetrics ( getFont ( ) ) .
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

^ At least since the first edition of Kernighan and Ritchie's The C Programming Language it's been customary to begin programming tutorials and classes with the "Hello World" program, a program that prints the string "Hello World" to the display.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

is automatically converted to a .String object by the compiler.^ The compiler recognizes that the two string literals have the same value and it performs a simple optimization of only creating one String object.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

A more comprehensive example

.
// OddEven.java
import javax.swing.JOptionPane;
 
public class OddEven {
    // "input" is the number that the user gives to the computer
    private int input; // a whole number("int" means integer)
 
    /*
     * This is the constructor method.^ Point; class dontChangePoint { public static void main(String args[]) { Point p1 = new Point(0, 0); dontChangePoint(p1); System.out.println(p1); } static void dontChangePoint(Point p) { p = new Point(38, 97); } } It prints: java.awt.Point[x=0,y=0] What happened in this example was that a copy of the reference p1 was passed to the dontChangePoint() method.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ If you have static block, constructor and main method in Java file then what will be the sequence of method calls?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ Our Particle class becomes: public class Particle { private double x; private double mass; public Particle(double x) { this(x, 1.0); } public Particle(double x, double mass) { this.x = x; this.mass = mass; } public double getX() { return x; } public void setX(double newX) { x = newX; } public double getWeight() { return 9.8*mass; } public double distanceFromOrigin() { return Math.abs(x); } } Note the new methods getX and setX. They are used in the following.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.It gets called when an object of the OddEven type * is being created.^ However, if the hashtable gets too full, then Hashtable.put will allocate a larger array for the table, copy all the old objects over, and then recursively re-call table.put(key, value) .
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ It may result in finalizers being called on live objects while other threads are concurrently manipulating those objects, resulting in erratic behavior or deadlock.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

^ I create a new node type called blue, does the table name also need to be blue?
  • OXXus.net: Web Hosting » Unix HELP 2 February 2010 15:16 UTC blog.oxxus.net [Source type: Original source]

*/ public OddEven() { /* * Code not shown for simplicity. .In most Java programs constructors can initialize objects * with default values, or create other objects that this object might use to perform its * functions.^ Java programs communicate with their methods using pass-by-value.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ To actually create the array (or any other object) use the new operator.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ When Externalizable objects are reconstituted, their default constructor is used.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

.In some Java programs, the constructor may simply be an empty function if nothing * needs to be initialized prior to the functioning of the object.^ An array object may be created and initialized when its reference is declared.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Killer Game Programming in Java By Andrew Davison May 2005 Print: $59.99 Ebook: $35.99 Bundle: $65.99 This comprehensive guide has everything you need to program Java games.
  • Java - O'Reilly Media 10 January 2010 20:48 UTC oreilly.com [Source type: General]

^ The object model employed by Objective-C is considerably different from that of the Java programming language.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

.In this program's case, an * empty constructor would suffice, but the constructor must exist, even if it is empty.^ On the other hand, because of limitations in Java atomicity guarantees, use of longs and doubles must be synchronized in cases where use of ints and floats sometimes would not be.
  • Draft Java Coding Standard 10 January 2010 20:48 UTC g.oswego.edu [Source type: Reference]

^ When you define a constructor , you must not specify a return type, even though it behaves much like a static factory method that returns an object.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

*/
} // This is the main method. .It gets called when this class is run through a Java interpreter. public static void main(String[] args) { /* * This line of code creates a new instance of this class called "number" (also known as an * Object) and initializes it by calling the constructor.^ If you have static block, constructor and main method in Java file then what will be the sequence of method calls?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ Strings are not a primitive type, but are instances of the String class.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Why not combine creation and initialization by calling initialize from within new ?
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

.The next line of code calls * the "showDialog()" method, which brings up a prompt to ask you for a number */ OddEven number = new OddEven(); number.
^ Tuples are record types that you make up on the fly, and can then pass around and interpret in distant pieces of code.
  • Born Again Delphi [printer-friendly] • The Register 2 February 2010 15:16 UTC www.theregister.co.uk [Source type: Original source]

^ While if you had to look up a value in a binary tree, it would only take 1 extra iteration/function call when the tree doubles in size.
  • Coding Horror: Getting the Interview Phone Screen Right 2 February 2010 15:16 UTC www.codinghorror.com [Source type: Original source]

^ In other words, you call a method on an object, and you get back an object (possibly a new one).
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

showDialog(); .} public void showDialog() { /* * "try" makes sure nothing goes wrong.^ You must thus make sure the import goes in each file that uses it, not just at the beginning.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

^ Within your try block you are free to act as if nothing has or can go wrong.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ You must make sure that two equal objects have the same hashCode, and if you want better hashtable performance, you should try to make most non-equal objects have different hashCodes.
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

If something does, * the interpreter skips to "catch" to see what it should do. */
.try { /* * The code below brings up a JOptionPane, which is a dialog box * The String returned by the "showInputDialog()" method is converted into * an integer, making the program treat it as a number instead of a word.^ The following program receives a customer number as an input parameter and returns the name and address as output parameters.
  • RPG Programming, Development, RPG Software Development Directory, Links,RPG Programmer, Programmers, Developer, Developers 2 February 2010 15:16 UTC www.mainframes.in [Source type: Reference]

^ Instead, the plug-in tries to detect bad coding practices (such as unconditional loops) or violations of contract (such as when overriding Object.equals()).
  • Open Source Software in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

^ Yourdon also includes a number of minor typos, like saying that arrays have a length() method (instead of a length field) and that modifiable strings are represented by StringClass (instead of StringBuffer ).
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

* .After that, this method calls a second method, calculate() that will * display either "Even" or "Odd."^ It's possible that for some object x that is an instance of some subclass C1 of C either there is no C1.m() method, or some method on x called super.m() .
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ A second drawback with both Smalltalk and Ruby is that initialize , being an ordinary method, does not chain: You must remember to begin your initialize methods with a call to the superclass's initialize method.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ Derive the ObjectInputStream and make it call the initTransient (or check for the interface) in either the resolveObject or the validateObjects method.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

*/
input = Integer.parseInt(JOptionPane.showInputDialog("Please .Enter A Number")); calculate(); } catch (NumberFormatException e) { /* * Getting in the catch block means that there was a problem with the format of * the number.^ The static keyword means that there is only one copy of this variable, regardless of the number of instances of the class that are created.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ (Actually, real-time Java gets around this problem by redefining new to mean "allocate from the current memory region," but redefining new is not a solution available to most of us.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ There is no built-in way to define custom number formatting for BigDecimal or BigInteger objects.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

.Probably some letters were typed in instead of a number.^ On the other hand you lose some precision that you probably didn't need for such large and small numbers anyway.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

*/
System.err.println("ERROR: Invalid input. .Please type in a numerical value."); } } /* * When this gets called, it sends a message to the interpreter.^ However, if the hashtable gets too full, then Hashtable.put will allocate a larger array for the table, copy all the old objects over, and then recursively re-call table.put(key, value) .
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ These values are implicitly typed: they are respectively two integers and a Lisp-specific data type called a "symbol", and do not have to be declared as such.
  • Lisp Programming Directory, Links. Development, Programmers, ProgrammerReference, Resources @ eIT.in 2 February 2010 15:16 UTC www.eit.in [Source type: Reference]

^ Some SQL dialects prefer to call this type NUMERIC , and others also include a MONEY data type, which is defined as a decimal number with two places to the right of the decimal.
  • Java theory and practice: Where's your point? 10 January 2010 20:48 UTC www.ibm.com [Source type: FILTERED WITH BAYES]

* .The interpreter usually shows it on the command prompt (For Windows users) * or the terminal (For Linux users).^ This is usually because the user left the page or minimized the window.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

(Assuming it's open) */
.private void calculate() { if (input % 2 == 0) { System.^ OddEven() { input = Integer.parseInt(JOptionPane.showInputDialog("Please Enter A Number")); } public void calculate() { if (input % 2 == 0) System.out.println("Even"); else System.out.println("Odd"); } public static void main(String[] args) { OddEven number = new OddEven(); number.calculate(); } } [/code] .
  • The Life Of A Radar » 2007 » September 2 February 2010 15:16 UTC ryanbigg.com [Source type: General]

out.println("Even"); } else { System.out.println("Odd"); .} } }
  • The import statement imports the JOptionPane class from the javax.swing package.
  • The OddEven class declares a single private field of type int named input.^ The limitation of having a fixed set of methods, and thus components, is overcome in Swing by using a mapping from a generic UI component name (such as "ButtonUI") to the name of an implementing class.
    • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

    ^ The access specifier public means that the variables and methods are available from any package; private implies that the variables and methods can only be accessed inside methods of the same class.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ This time we need more than one class from the awt package so rather than worrying about which one to import, we just get them all with the * .
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    .Every instance of the OddEven class has its own copy of the input field.^ The static keyword means that there is only one copy of this variable, regardless of the number of instances of the class that are created.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ Fields in the class are template for the instance variables that are created when objects are instantiated (created) from that class.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    .The private declaration means that no other class can access (read or write) the input field.
  • OddEven() is a public constructor.^ In other words it declares what certain classes do .
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    ^ The access specifier public means that the variables and methods are available from any package; private implies that the variables and methods can only be accessed inside methods of the same class.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ Particle { double x, y, vx, vy, mass; // these variables can be used by any method in the class // example of constructor method public Particle(double x, double y, double vx, double vy, double mass) { /* Use this keyword to make explicit that a method is accessing its own variables.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    .Constructors have the same name as the enclosing class they are declared in, and unlike a method, have no return type.^ The name of the constructor is the same as the name of the class.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ If the return type is void then no value will be returned.
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    ^ The class in that instance was of no importance; the METHOD was.
    • Coding Horror: Getting the Interview Phone Screen Right 2 February 2010 15:16 UTC www.codinghorror.com [Source type: Original source]

    .A constructor is used to initialize an object that is a newly created instance of the class.
  • The calculate() method is declared without the static keyword.^ An array object may be created and initialized when its reference is declared.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ To call a static method we use the class name rather than an instance name.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ It is declared static meaning that all instances of this class share this one method.
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    .This means that the method is invoked using a specific instance of the OddEven class.^ An object is a specific instance of a class.
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    ^ The class in that instance was of no importance; the METHOD was.
    • Coding Horror: Getting the Interview Phone Screen Right 2 February 2010 15:16 UTC www.codinghorror.com [Source type: Original source]

    ^ What does it mean that a method or class is abstract ?
    • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

    .(The reference used to invoke the method is passed as an undeclared parameter of type OddEven named this.^ JavaMan22, use extern type name; .
    • OXXus.net: Web Hosting » 2007 » September 2 February 2010 15:16 UTC blog.oxxus.net [Source type: Original source]

    ^ We use the this keyword to refer to those variables defined for the entire class in contrast to those defined locally within a method and those that are arguments to a method.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ Java programs communicate with their methods using pass-by-value.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ) .The method tests the expression input % 2 == 0 using the if keyword to see if the remainder of dividing the input field belonging to the instance of the class by two is zero.^ The class in that instance was of no importance; the METHOD was.
    • Coding Horror: Getting the Interview Phone Screen Right 2 February 2010 15:16 UTC www.codinghorror.com [Source type: Original source]

    ^ Test using main method .

    ^ Methods and the instance variables of a class have class scope.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    .If this expression is true, then it prints Even; if this expression is false it prints Odd.^ You can also use {{{SPM:expression}}}, where 'expression' is any javascript statement that evaluates to true or false.
    • TiddlyFolio - Your Wiki Wallet v0.98b beta for Firefox 2 February 2010 15:16 UTC tiddlyfolio.tiddlyspot.com [Source type: FILTERED WITH BAYES]

    (The input field can be equivalently accessed as this.input, which explicitly uses the undeclared this parameter.)
  • .
  • OddEven number = new OddEven(); declares a local object reference variable in the main method named number.^ Can an inner class declared inside of a method access local variables of this method?
    • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

    ^ Because a String variable is an object, it has methods.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ An array object may be created and initialized when its reference is declared.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    .This variable can hold a reference to an object of type OddEven.^ However, if that variable is a reference to an object, it will not necessarily prevent the various fields in that object from being changed, e.
    • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

    ^ Now the method invoked by entry.equals(key) depends upon the actual run-time type of the object referenced by entry , and the declared, compile-time type of the variable key .
    • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

    ^ A long is an integer type variable that can hold up to 9,223,372,036,854,775,807.
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    .The declaration initializes number by first creating an instance of the OddEven class, using the new keyword and the OddEven() constructor, and then assigning this instance to the variable.
  • The statement number.showDialog(); calls the calculate method.^ Methods can be created only as part of a class.
    • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

    ^ Then we initialize the variables using statements like " lower = 0 ".
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    ^ Why not combine creation and initialization by calling initialize from within new ?
    • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

    The instance of OddEven object referenced by the number local variable is used to invoke the method and passed as the undeclared this parameter to the calculate method.
  • input = new Integer(JOptionPane.showInputDialog("Please Enter A Number")); is a statement that converts the type of String to the primitive data type int by taking advantage of the primitive wrapper class Integer.

Special classes

Applet

.Java applets are programs that are embedded in other applications, typically in a Web page displayed in a Web browser.^ Java applications as #include is in C programs.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ How can you display a particular web page from an applet?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ See also the Java Programming Resource page.
  • Java Skyline: Java Servlet/Server Headline News 10 January 2010 20:48 UTC www.javaskyline.com [Source type: General]

.
// Hello.java
import javax.swing.JApplet;
import java.awt.Graphics;
 
public class Hello extends JApplet {
    public void paintComponent(Graphics g) {
        g.^ An applet is a Java class which extends java.applet.Applet .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ The Graphics class is defined in the java.awt.Graphics package which we've imported.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Applet; import java.awt.Graphics; public class HelloWorldApplet extends Applet { public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); } } This applet version of HelloWorld is a little more complicated than the HelloWorld application of the previous chapter, and it will take a little more effort to run it as well.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

drawString("Hello, world!", 65, 95); } }
.The import statements direct the Java compiler to include the javax.swing.JApplet and java.awt.Graphics classes in the compilation.^ The first one is the second import statement, import java.awt.* .
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The Graphics class is defined in the java.awt.Graphics package which we've imported.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Features that Java adds include mandatory typing, exception and thread support in the language, security managers, name spaces, predefined class libraries (java.lang, awt), etc.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

The import statement allows these classes to be referenced in the source code using the simple class name (i.e. JApplet) instead of the fully qualified class name (i.e. javax.swing.JApplet).
.The Hello class extends (subclasses) the JApplet (Java Applet) class; the JApplet class provides the framework for the host application to display and control the lifecycle of the applet.^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ An applet is a Java class which extends java.applet.Applet .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ For this purpose Java provides the StreamTokenizer class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.The JApplet class is a JComponent (Java Graphical Component) which provides the applet with the capability to display a graphical user interface (GUI) and respond to user events.^ GUIs (Graphic User interface).

^ For this purpose Java provides the StreamTokenizer class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ BindowsFaces provides Java developers with a market leading client-side component model, built from the ground up with TRUE object-oriented Ajax.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

.The Hello class overrides the paintComponent(Graphics) method inherited from the Container superclass to provide the code to display the applet.^ The pixels get put on the screen in the update() method which most applets don't override.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Simplicity Professional Simplicity Professional provides you with an intuitive graphical method of integrating data into your applications from any JDBC/ODBC data source.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ All objects have a toString method which is inherited from the Object class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.The paintComponent() method is passed a Graphics object that contains the graphic context used to display the applet.^ The paint method is passed a Graphics object which we've chosen to call g.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ To do this we'll use a new methods setColor(), part of the Graphics class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ In this case we're requesting access to the public classes contained in the basic release, java.applet.Applet and java.awt.Graphics.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.The paintComponent() method calls the graphic context drawString(String, int, int) method to display the "Hello, world!" string at a pixel offset of (65, 95) from the upper-left corner in the applet's display.^ Within the paint method we call g's drawString method to draw the string "Hello World!"
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ List.addItem("stop event"); } start The start() method is called when a user brings their attention back to an applet, for instance after maximizing a window or returning to the applet's page.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ In Java the coordinate system for an applet begins in the upper left hand corner and increases to the right and down.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!-- Hello.html -->
<html>
  <head>
    <title>Hello World Applet</title>
  </head>
  <body>
    <applet code="Hello" width="200" height="200">
    </applet>
  </body>
</html>
.An applet is placed in an HTML document using the <applet> HTML element.^ ALIGN also works exactly as for images (in those browsers that support ALIGN) defining how the applet's rectangle is placed on the page relative to other elements.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ To refer to the containing DOM element from within an 'onclick' script, you can use "place.parentNode" instead.
  • TiddlyFolio - Your Wiki Wallet v0.98b beta for Firefox 2 February 2010 15:16 UTC tiddlyfolio.tiddlyspot.com [Source type: FILTERED WITH BAYES]

^ As a result, ''you cannot use a bookmarklet to generate dynamic output in your document,'' and using {{{document.write()}}} or returning wiki-syntax text or making reference to the 'place' DOM element will halt the script and report a "Reference Error" when that bookmarklet is invoked.
  • TiddlyFolio - Your Wiki Wallet v0.98b beta for Firefox 2 February 2010 15:16 UTC tiddlyfolio.tiddlyspot.com [Source type: FILTERED WITH BAYES]

.The applet tag has three attributes set: code="Hello" specifies the name of the JApplet class and width="200" height="200" sets the pixel width and height of the applet.^ Set the height of the applet to 300 pixels and the width to 300 pixels as well.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The limitation of having a fixed set of methods, and thus components, is overcome in Swing by using a mapping from a generic UI component name (such as "ButtonUI") to the name of an implementing class.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ For reasons we'll see later it's advisable to give the source code file the same name as the main class in the file plus the .java extension.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Applets may also be embedded in HTML using either the object or embed element,[32] although support for these elements by Web browsers is inconsistent.^ Integrated Development Environments (IDEs), web browsers, compilers, applet viewers, Rapid Application Development (RAD) tools, class browsers, visual interface builders, and other tools.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Django, in contrast, uses a simpler templating language conceived specifically so that web designers with HTML skills, but minimal programming knowledge, can build templates.
  • The Python Papers Volume 2, Issue 2 2 February 2010 15:16 UTC www.scribd.com [Source type: FILTERED WITH BAYES]
  • The Python Papers, Volume 2, Issue 2 2 February 2010 15:16 UTC archive.pythonpapers.org [Source type: FILTERED WITH BAYES]

^ However, TiddlyWiki does not also process the HTML source content for any embedded wiki-formatting syntax it may contain.
  • TiddlyFolio - Your Wiki Wallet v0.98b beta for Firefox 2 February 2010 15:16 UTC tiddlyfolio.tiddlyspot.com [Source type: FILTERED WITH BAYES]

[33] .However, the applet tag is deprecated, so the object tag is preferred where supported.^ However a non-Java capable browser will ignore the APPLET tags instead and read the text between them.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The actions of both applets and applications, however, can be controlled by SecurityManager objects.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.The host application, typically a Web browser, instantiates the Hello applet and creates an AppletContext for the applet.^ Integrated Development Environments (IDEs), web browsers, compilers, applet viewers, Rapid Application Development (RAD) tools, class browsers, visual interface builders, and other tools.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ An applet is a program which is run in the context of an applet viewer or web browser, and which has strictly limited access to the host system.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ For instance an applet can normally not read or write files on the host system whereas an application normally can.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

Once the applet has initialized itself, it is added to the AWT display hierarchy. .The paintComponent() method is called by the AWT event dispatching thread whenever the display needs the applet to draw itself.^ List.addItem("stop event"); } start The start() method is called when a user brings their attention back to an applet, for instance after maximizing a window or returning to the applet's page.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Instead, whenever the frame is shown, the paint method is called.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ The parameter-list is a comma-separated list containing the parameters received by the method whenever it is called.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

Servlet

.Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems.^ Java and SOAP Java and SOAP provides Java developers with an in-depth look at SOAP (the Simple Object Access Protocol).
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ Chrysalis is a Java web development framework.
  • Open Source Web Frameworks in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

^ What is Java server technology?
  • Java Skyline: Java Servlet/Server Headline News 10 January 2010 20:48 UTC www.javaskyline.com [Source type: General]

.Servlets are server-side Java EE components that generate responses (typically HTML pages) to requests (typically HTTP requests) from clients.^ Jaxcent is a server-side Java framework.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

^ The server side is currently Java only.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

^ BindowsFaces provides Java developers with a market leading client-side component model, built from the ground up with TRUE object-oriented Ajax.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

.A servlet can almost be thought of as an applet that runs on the server side—without a face.^ This is almost always means Netscape can't find one of the classes it needs to run the applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ The Laszlo Presentation Server (LPS) is a Java servlet that compiles LZX applications into executable binaries for targeted run-time environments.
  • Open Source Software in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

^ Publishing this as a cgi-bin would bring my server to its knees, but by publishing it as a Java applet I can distribute the load across all the machines that want to run it.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.
// Hello.java
import java.io.*;
import javax.servlet.*;
 
public class Hello extends GenericServlet {
    public void service(ServletRequest request, ServletResponse response) 
            throws ServletException, IOException {
       response.^ An applet is a Java class which extends java.applet.Applet .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Applet; import java.awt.Graphics; public class HelloWorldApplet extends Applet { public void paint(Graphics g) { g.drawString("Hello world!", 50, 25); } } This applet version of HelloWorld is a little more complicated than the HelloWorld application of the previous chapter, and it will take a little more effort to run it as well.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

setContentType("text/html"); final PrintWriter pw = response.getWriter(); pw.println("Hello, world!"); pw.close(); } }
.The import statements direct the Java compiler to include all of the public classes and interfaces from the java.io and javax.servlet packages in the compilation.^ The notation java.awt.* means that all the classes in the java.awt package can be used.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ The Applet class is defined in the java.applet.Applet package which we just imported.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ The Graphics class is defined in the java.awt.Graphics package which we've imported.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.The Hello class extends the GenericServlet class; the GenericServlet class provides the interface for the server to forward requests to the servlet and control the servlet's lifecycle.^ The server designer would provide an interface: .
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ It extends the JSF request lifecycle to work in a Single Page Interface environment, it synchronizes client-server state and facilitates data binding.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

^ MPD WebAMP provides a browser based interface to control music playback via MPD. It includes it's own CherryPy web server and provides a single page application with the features and interface one would expect from a standard desktop application.
  • The Python Papers Volume 2, Issue 2 2 February 2010 15:16 UTC www.scribd.com [Source type: FILTERED WITH BAYES]
  • The Python Papers, Volume 2, Issue 2 2 February 2010 15:16 UTC archive.pythonpapers.org [Source type: FILTERED WITH BAYES]

.The Hello class overrides the service(ServletRequest, ServletResponse) method defined by the Servlet interface to provide the code for the service request handler.^ However we will note that an interface defines methods that a class implements.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Each service defines a Java interface it implements.
  • Open Source Software in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

^ It is the responsibility of each class that implements an interface to provide code to handle the cases where the methods of the interface are called.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.The service() method is passed a ServletRequest object that contains the request from the client and a ServletResponse object used to create the response returned to the client.^ When an object is reconstituted, the default constructor of any non-serializable superclass is run, not the constructor that was actually used to originally create the object.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

^ Getting Started with Web Services, JSR 172 leads Java ME Platform developers through creating a simple hardcoded service example and a MIDlet that uses JSR 172 to interact with that service.

^ Java programs communicate with their methods using pass-by-value.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

The service() method declares that it throws the exceptions ServletException and IOException if a problem prevents it from responding to the request.
.The setContentType(String) method in the response object is called to set the MIME content type of the returned data to "text/html".^ Only objects and primitive data types can be passed to methods.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ A call to the execute method always returns a ResultSet object.
  • Platform Selection - Our Agile Dev Processes - Wiki.Directi 2 February 2010 15:16 UTC wiki.directi.com [Source type: FILTERED WITH BAYES]

^ C for the equals method with argument of type Object .
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

.The getWriter() method in the response returns a PrintWriter object that is used to write the data that is sent to the client.^ How to use an array returned by a method .
  • Java Forum | DreamInCode.net 10 January 2010 20:48 UTC www.dreamincode.net [Source type: General]

^ Consuming and Binding EJBs and Data in Creator Discover how to use EJBs and the data returned from them to bind into on-page controls within Sun Java Studio Creator.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ To write platform independent code, you should use the system file.separator and path.separator, or use the File methods that construct filenames for you from parts.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

.The println(String) method is called to write the "Hello, world!" string to the response and then the close() method is called to close the print writer, which causes the data that has been written to the stream to be returned to the client.^ Within the paint method we call g's drawString method to draw the string "Hello World!"
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ That's because the print method must be called by a specific instance of the website class, and this instance knows what its data is.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ List.addItem("stop event"); } start The start() method is called when a user brings their attention back to an applet, for instance after maximizing a window or returning to the applet's page.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

JavaServer Page

.JavaServer Pages (JSPs) are server-side Java EE components that generate responses, typically HTML pages, to HTTP requests from clients.^ Jaxcent is a server-side Java framework.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

^ The server side is currently Java only.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

^ BindowsFaces provides Java developers with a market leading client-side component model, built from the ground up with TRUE object-oriented Ajax.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

.JSPs embed Java code in an HTML page by using the special delimiters <% and %>.^ Vroom is a framework for HTML/JSP and Java code binding.
  • Open Source Web Frameworks in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

^ Flexjson is a lightweight library for serializing Java objects into JSON using jsp framework.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

^ Using Program Parameters in Java Each of us, as Java programmers will encounter situations where choices must be made between various coding solutions.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

.A JSP is compiled to a Java servlet, a Java application in its own right, the first time it is accessed.^ This component can be integrated in any JSP/Servlets application.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ The Java Servers page lists product manufacturers for Java-based Web Servlet, JSP, and EJB servers.
  • Java Skyline: Java Servlet/Server Headline News 10 January 2010 20:48 UTC www.javaskyline.com [Source type: General]

^ JSPWiki - A WikiWiki web clone written using JSPs and Servlets See all Open Source Wiki Engines in Java Open Source Workflow Engines in Java .
  • Open Source Software in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

After that, the generated servlet creates the response.

Swing application

.Swing is a graphical user interface library for the Java SE platform.^ GUIs (Graphic User interface).

^ Java Platform, Standard Edition (Java SE): entornos workstation – Java Platform, Enterprise Edition (Java EE): entornos distribuidos – Otras: Java Card,...

^ This package implements the Java Abstract Window Toolkit (AWT) and contains all the classes and interfaces necessary for creating a user interface.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.It is possible to specify a different look and feel through the pluggable look and feel system of Swing.^ It is also possible to create your own look and feel.
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

^ It does not specify the look and feel of these “admin” pages.
  • The Python Papers Volume 2, Issue 2 2 February 2010 15:16 UTC www.scribd.com [Source type: FILTERED WITH BAYES]
  • The Python Papers, Volume 2, Issue 2 2 February 2010 15:16 UTC archive.pythonpapers.org [Source type: FILTERED WITH BAYES]

Clones of Windows, GTK+ and Motif are supplied by Sun. Apple also provides an Aqua look and feel for Mac OS X. .Where prior implementations of these looks and feels may have been considered lacking, Swing in Java SE 6 addresses this problem by using more native GUI widget drawing routines of the underlying platforms.^ Outside of its server space success, Sun has pushed Java as an ideal platform for mobile devices using a stripped down micro edition called Java ME (formerly J2ME, and distinguished from the desktop Java SE standard edition and server Java EE enterprise edition).
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ For more detailed information on the kinds of games and interactive exercises I’ll use for this session please follow one or more of these links to descriptions of sessions I have run previously.
  • December 2009 - Posts - Angel "Java" Lopez 2 February 2010 15:16 UTC msmvps.com [Source type: General]

^ That’s because developers interested in delivering their software across platforms are more likely to use either their own in house development tools to code cross platform or port their interface code to Apple’s native Cocoa frameworks rather than to use Java to bridge the Windows/Mac/Linux divide.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

.This example Swing application creates a single window with "Hello, world!"^ Here's an example of exception handling in Java using the Hello World program above: .
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ For example, you have a MainWindow class in your application, and you want to count the number of windows that the user has opened, and initiate the "Really quit?"
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ The Hello World Applet adds several constructs to what we saw in the Hello World Application.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

inside:
.
// Hello.java (Java SE 5)
import javax.swing.*;
 
public class Hello extends JFrame {
    public Hello() {
        setDefaultCloseOperation(WindowConstants.^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ For example, consider this program: import java.awt.Point; class changePoint { public static void main(String args[]) { Point p1 = new Point(0, 0); changePoint(p1); System.out.println(p1); } static void changePoint(Point p) { p.x = 38; p.y = 97; } } It prints: java.awt.Point[x=38,y=97] Therefore the point has been changed.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ We just change g.drawRect(0, 0, width, height); to g.drawRect(0, 0, width-1, height-1); //Draw a rectangle import java.applet.*; import java.awt.*; public class Mondrian2 extends Applet { int height, width; public void init() { Dimension d = size(); height = d.height; width = d.width; repaint(); } public void paint(Graphics g) { g.drawRect(0, 0, width-1, height-1); } } As usual compile this and load it into your browser.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

EXIT_ON_CLOSE); add(new .JLabel("Hello, world!")); pack(); } public static void main(String[] args) { new Hello().^ Swap2 { public static void main(String args[]) { int a = 1; int b = 2; int temp; System.out.println("a = "+a); System.out.println("b = "+b); // swap a and b temp = a; a = b; b = temp; System.out.println("a = "+a); System.out.println("b = "+b); } } This code produces the output we expect: a = 1 b = 2 a = 2 b = 1 Bubble Sort .
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Fill3DArray { public static void main (String args[]) { int[][][] M; M = new int[4][5][3]; for (int row=0; row < 4; row++) { for (int col=0; col < 5; col++) { for (int ver=0; ver < 3; ver++) { M[row][col][ver] = row+col+ver; } } } } } We need three nested for loops here to handle the extra dimension.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Channel { private AutoResetEvent sethandle = new AutoResetEvent( false ); private AutoResetEvent gethandle = new AutoResetEvent( false ); private object value ; public void Send( object value ) { this .gethandle.WaitOne(); this .
  • Angel "Java" Lopez 2 February 2010 15:16 UTC msmvps.com [Source type: General]
  • December 2009 - Posts - Angel "Java" Lopez 2 February 2010 15:16 UTC msmvps.com [Source type: General]

setVisible(true); } }
.The first import includes all of the public classes and interfaces from the javax.swing package.^ The access specifier public means that the variables and methods are available from any package; private implies that the variables and methods can only be accessed inside methods of the same class.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Tsundere "tsundere," is a term used to describe girls that are cold and strict at first or in public, but becomes all lovey-dovey when they are alone together.
  • Japanese otaku lingo [Archive] - AnimeSuki Forum 2 February 2010 15:16 UTC forums.animesuki.com [Source type: General]

^ This package implements the Java Abstract Window Toolkit (AWT) and contains all the classes and interfaces necessary for creating a user interface.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.The Hello class extends the JFrame class; the JFrame class implements a window with a title bar and a close control.^ In part, this was because Apple didn’t partner with Microsoft or delegate it control of the QuickTime implementation on Windows in the way Sun foolishly did with Java.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ Normally you would implement this by having each class extend a common superclass.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Can an anonymous class implement an interface and extend a class at the same time?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

.The Hello() constructor initializes the frame by first calling the superclass constructor, passing the parameter "hello", which is used as the window's title.^ The standard C libraries (and many others including the Windows API) also use pointers extensively as both parameters and results.
  • The Joel on Software Discussion Group - What is the "point" of POINTERS? 2 February 2010 15:16 UTC discuss.joelonsoftware.com [Source type: FILTERED WITH BAYES]

^ The order of evaluation (ignoring out of memory problems) when you say new C() is: Call a constructor for C's superclass (unless C is Object , in which case it has no superclass).
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ When an object is reconstituted, the default constructor of any non-serializable superclass is run, not the constructor that was actually used to originally create the object.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

.It then calls the setDefaultCloseOperation(int) method inherited from JFrame to set the default operation when the close control on the title bar is selected to WindowConstants.EXIT_ON_CLOSE — this causes the JFrame to be disposed of when the frame is closed (as opposed to merely hidden), which allows the JVM to exit and the program to terminate.^ Regarding the terminal, the terminal causes the stream the program is using to close.
  • OXXus.net: Web Hosting » 2007 » September 2 February 2010 15:16 UTC blog.oxxus.net [Source type: Original source]

^ In computer programming recursion is achieved by allowing a method to call itself.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Each calculation part of a program is called a method.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

.Next, the layout of the frame is set to a BorderLayout; this tells Swing how to arrange the components that will be added to the frame.^ It utilizes the models, events, and event listeners of Swing and organizes the components as a hierarchy of containers with layout managers.
  • Open Source Web Frameworks in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

^ The limitation of having a fixed set of methods, and thus components, is overcome in Swing by using a mapping from a generic UI component name (such as "ButtonUI") to the name of an implementing class.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ Bits and Bytes Tell me how to test whether the high-order bit is set in a byte.
  • Coding Horror: Getting the Interview Phone Screen Right 2 February 2010 15:16 UTC www.codinghorror.com [Source type: Original source]

.A JLabel is created for the string "Hello, world!" and the add(Component) method inherited from the Container superclass is called to add the label to the frame.^ Within the paint method we call g's drawString method to draw the string "Hello World!"
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ However, this is also not correct: CREATE VIEW for example does contain a query expression, but this would most likely not be called a sub query.
  • Platform Selection - Our Agile Dev Processes - Wiki.Directi 2 February 2010 15:16 UTC wiki.directi.com [Source type: FILTERED WITH BAYES]

^ Thus in the statement: return true if the event has been handled and no further action is necessary; false if the event is to be given to the component's parent the word parent means the component's container, not its superclass.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.The pack() method inherited from the Window superclass is called to size the window and lay out its contents.^ The order of evaluation (ignoring out of memory problems) when you say new C() is: Call a constructor for C's superclass (unless C is Object , in which case it has no superclass).
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ List.addItem("stop event"); } start The start() method is called when a user brings their attention back to an applet, for instance after maximizing a window or returning to the applet's page.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ In addition, if one covers the frame with another window, the paint method will be called again when the frame is uncovered.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.The main() method is called by the JVM when the program starts.^ If you have static block, constructor and main method in Java file then what will be the sequence of method calls?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ Object-oriented programming focuses on constructs called “objects.” An object consists of data and functions known as methods which use or change the data.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ This common error occurs when you attempt to call an instance method from a static method, most commonly main() .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.It instantiates a new Hello frame and causes it to be displayed by calling the setVisible(boolean) method inherited from the Component superclass with the boolean parameter true.^ Thus in the statement: return true if the event has been handled and no further action is necessary; false if the event is to be given to the component's parent the word parent means the component's container, not its superclass.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ Instead, whenever the frame is shown, the paint method is called.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Boolean.TRUE : Boolean.FALSE) , which recycles an existing value rather than wastefully creating a new one.
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

.Once the frame is displayed, exiting the main method does not cause the program to terminate because the AWT event dispatching thread remains active until all of the Swing top-level windows have been disposed.^ A. To ensure that Swing components are updated through the event-dispatching thread.
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

^ The above programs have already used a number of methods although these were all methods provided by the system.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Finally when the main method is called it does exactly one thing: print "Hello World" to the standard output, generally a terminal monitor or console window of some sort.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

Generics

.In 2004 generics were added to the Java language, as part of J2SE 5.0. Prior to the introduction of generics, each variable declaration had to be of a specific type.^ Code to initialise variables as part of the declaration e.g.
  • gotchas : Java Glossary 10 January 2010 20:48 UTC mindprod.com [Source type: FILTERED WITH BAYES]

^ Enterprise JavaBeans, 3rd Edition - Part 2 In the new 3rd edition, Enterprise JavaBeans has been completely revised and updated with a thorough introduction to the new 2.0 version of the EJB specification.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ J2EE Deployment Specification Why is it that J2EE applications written in the same language, Java, may not coexist on different servers?
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

.For container classes, for example, this is a problem because there is no easy way to create a container that accepts only specific types of objects.^ Methods can be created only as part of a class.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ An object is a specific instance of a class.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ There are a couple of ways around this problem.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.Either the container operates on all subtypes of a class or interface, usually Object, or a different container class has to be created for each contained class.^ The factory class is abstract (or is an interface) and declares a method for creating an object.
  • Dr. Dobb's | Java's new Considered Harmful | April 1, 2002 10 January 2010 20:48 UTC www.ddj.com [Source type: FILTERED WITH BAYES]

^ First of all, consider if two objects of different class can be equal.
  • Java IAQ: Infrequently Answered Questions 10 January 2010 20:48 UTC norvig.com [Source type: FILTERED WITH BAYES]

^ What is the difference between an abstract class and an interface?
  • Interview Questions On Java,Java EE 10 January 2010 20:48 UTC www.interviewjava.com [Source type: FILTERED WITH BAYES]

.Generics allow compile-time type checking without having to create a large number of container classes, each containing almost identical code.^ Clojure newbie question regarding compile time type checking.
  • Clojure newbie question regarding compile time type checking. - Clojure | Google Groups 2 February 2010 15:16 UTC groups.google.com [Source type: FILTERED WITH BAYES]

^ The compiler checks the validity of my code without locking me into a type system.
  • Yariv’s Blog » Blog Archive » Ericsson’s Biggest PR Blunder: Forgetting to Tell Us That Erlang Programming Is FUN 2 February 2010 15:16 UTC yarivsblog.com [Source type: General]

^ AjaxTags is, in short, an exceedingly simple, powerful and flexible way to introduce AJAX into your applications without having to write ANY code yourself!
  • Java Ajax Frameworks - Ajax Patterns 10 January 2010 20:48 UTC ajaxpatterns.org [Source type: Reference]

Class libraries

.
Java Platform and Class libraries diagram
  • Java libraries are the compiled bytecodes of source code developed by the JRE implementor to support application development in Java.^ Java applications are typically compiled to bytecode , although compilation to native machine code is also possible.
    • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

    ^ Sun has made the Java Developers Kit available for its supported platforms.
    • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

    ^ The studio supports both visual and source-code level development.
    • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

    .Examples of these libraries are:
    • The core libraries, which include:
    • The integration libraries, which allow the application writer to communicate with external systems.^ The HKEY_LOCAL_MACHINE subtree contains information about the local computer system, including hardware and operating system data, such as bus type, system memory, device drivers, and startup control parameters."
      • » Windows XP se stále prodávají více než Vista - Petr Krčmář: blog nejen o Linuxu 2 February 2010 15:16 UTC petrkrcmar.blog.root.cz [Source type: Academic]

      ^ I know for a fact that I would answer something along these lines but I would also be perfectly capable of solving both the data structure and HTML parsing question.
      • Coding Horror: Getting the Interview Phone Screen Right 2 February 2010 15:16 UTC www.codinghorror.com [Source type: Original source]

      ^ Simplicity Professional Simplicity Professional provides you with an intuitive graphical method of integrating data into your applications from any JDBC/ODBC data source.
      • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

      These libraries include:
    • User interface libraries, which include:
      • The (heavyweight, or native) Abstract Window Toolkit (AWT), which provides GUI components, the means for laying out those components and the means for handling events from those components
      • The (lightweight) Swing libraries, which are built on AWT but provide (non-native) implementations of the AWT widgetry
      • APIs for audio capture, processing, and playback
  • A platform dependent implementation of Java Virtual Machine (JVM) that is the means by which the byte codes of the Java libraries and third party applications are executed
  • Plugins, which enable applets to be run in Web browsers
  • Java Web Start, which allows Java applications to be efficiently distributed to end-users across the Internet
  • Licensing and documentation.

Documentation

.Javadoc is a comprehensive documentation system, created by Sun Microsystems, used by many Java developers.^ We also use Java in many internal systems and products under development.
  • "Java Is Dead, Long Live Java!" – The Future of Java | JAVA Developer's Journal 10 January 2010 20:48 UTC java.sys-con.com [Source type: General]

^ Sun's Java Documentation or better JavaDoc2 .
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Developing Ajax Web Applications using ThinWire and Java ThinWire makes it as easy to develop rich web applications as it is to write standalone Java applications.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

.It provides developers with an organized system for documenting their code.^ Developed jointly by MIT Libraries and Hewlett-Packard (HP), DSpace is now freely available to organizations worldwide as an open source system that can be customized and extended.
  • Open Source Software in Java 10 January 2010 20:48 UTC java-source.net [Source type: Reference]

^ The components included in iNet Factory provide all the tools necessary to quickly develop network capable Java(TM) applications with minimum coding effort.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

^ It provides a default desktop with some base applications and the ability of developing new applications with the eyeOS Toolkit, the integrated IDE , which can be installed through the ports-based eyeSoft system.
  • DotNet « Le blog de Patrick Vergain 2 February 2010 15:16 UTC pvergain.wordpress.com [Source type: FILTERED WITH BAYES]

.Whereas normal comments in Java and C are set off with /* and */, the multi-line comment tags, Javadoc comments have an extra asterisk at the beginning, so that the tags are /** and */.^ Multiple line comments begin with /* and end with */ ; these are also useful for commenting out a portion of the text on a line.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

Examples

The following is an example of java code commented with simple Javadoc-style comments:
.
/**
 * A program that does useful things.^ Then put the songs on there without using a program that renames them stupid things.
  • #rockbox 2008-05-07 2 February 2010 15:16 UTC www.rockbox.org [Source type: FILTERED WITH BAYES]

^ Me: No, it's really a general-purpose programming language that can be used for any number of things.
  • Hacker News | Why Lisp Is Unpopular 2 February 2010 15:16 UTC news.ycombinator.com [Source type: Original source]

^ I tried: (print "Hello World") The result I expected was: Hello World The result I got was: "Hello World" In the language we are using, the "Hello World" program is simply: Hello World but, this is my anti-Lisp bias thing.
  • Hacker News | I'm turning into a Lisp snob 2 February 2010 15:16 UTC news.ycombinator.com [Source type: Original source]

*/ .public class Program { /** * A main method.^ Point; class dontChangePoint { public static void main(String args[]) { Point p1 = new Point(0, 0); dontChangePoint(p1); System.out.println(p1); } static void dontChangePoint(Point p) { p = new Point(38, 97); } } It prints: java.awt.Point[x=0,y=0] What happened in this example was that a copy of the reference p1 was passed to the dontChangePoint() method.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ A class which extends java.applet.Applet and also has a main() method is both an application and an applet.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ For example, consider this program: import java.awt.Point; class changePoint { public static void main(String args[]) { Point p1 = new Point(0, 0); changePoint(p1); System.out.println(p1); } static void changePoint(Point p) { p.x = 38; p.y = 97; } } It prints: java.awt.Point[x=38,y=97] Therefore the point has been changed.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

* @param args The arguments */
public static void main(String[] args) { //do stuff } }

Editions

Java editions
Wave.svg
Java Card
Micro Edition (ME)
Standard Edition (SE)
Enterprise Edition (EE)
PersonalJava (discontinued)
.Sun has defined and supports four editions of Java targeting different application environments and segmented many of its APIs so that they belong to one of the platforms.^ Sun has made the Java Developers Kit available for its supported platforms.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Outside of its server space success, Sun has pushed Java as an ideal platform for mobile devices using a stripped down micro edition called Java ME (formerly J2ME, and distinguished from the desktop Java SE standard edition and server Java EE enterprise edition).
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ Java Platform, Standard Edition (Java SE): entornos workstation – Java Platform, Enterprise Edition (Java EE): entornos distribuidos – Otras: Java Card,...

The platforms are:
.The classes in the Java APIs are organized into separate groups called packages.^ How do I call the native API from Java?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ This package implements the Java Abstract Window Toolkit (AWT) and contains all the classes and interfaces necessary for creating a user interface.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

^ Java provides ready-made type-wrapper classes in the java.lang package for Boolean , Character , Integer , Double , Float , and Long .
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

.Each package contains a set of related interfaces, classes and exceptions.^ A package is merely a collection of related classes.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ It pulls in the classes that are contained in a package elsewhere.
  • Brewing Java: A Tutorial 10 January 2010 20:48 UTC www.ibiblio.org [Source type: FILTERED WITH BAYES]

^ Explicitly add the path containing your class or package to the CLASSPATH as specified in the previous question.
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

Refer to the separate platforms for a description of the packages available.
.The set of APIs is controlled by Sun Microsystems in cooperation with others through the Java Community Process program.^ Programming Applets 5.1: Can applets communicate with each other?
  • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

^ In part, this was because Apple didn’t partner with Microsoft or delegate it control of the QuickTime implementation on Windows in the way Sun foolishly did with Java.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ Java programs communicate with their methods using pass-by-value.
  • Introduction to Java 10 January 2010 20:48 UTC sip.clarku.edu [Source type: Reference]

.Companies or individuals participating in this process can influence the design and development of the APIs.^ The Java Data Mining API Data mining is a very important process used by most companies today.
  • Java / WebDeveloper.com ® 10 January 2010 20:48 UTC www.webdeveloper.com [Source type: FILTERED WITH BAYES]

This process has been a subject of controversy.
.Sun also provided an edition called PersonalJava that has been superseded by later, standards-based Java ME configuration-profile pairings.^ Outside of its server space success, Sun has pushed Java as an ideal platform for mobile devices using a stripped down micro edition called Java ME (formerly J2ME, and distinguished from the desktop Java SE standard edition and server Java EE enterprise edition).
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

^ Java Platform, Standard Edition (Java SE): entornos workstation – Java Platform, Enterprise Edition (Java EE): entornos distribuidos – Otras: Java Card,...

^ Java wrote an interesting post today onHere’s a quick excerptShortly after Apple announced the iPhone SDK, Sun announced the intention to bring its Java Micro Edition platform to the iPhone.
  • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

Criticism

See also

Notes

  1. ^ Java 5.0 added several new language features (the enhanced for loop, autoboxing, varargs and annotations), after they were introduced in the similar (and competing) C# language [1][2]
  2. ^ "About Microsoft's "Delegates"". http://java.sun.com/docs/white/delegates.html. Retrieved 2010-01-11. "We looked very carefully at Delphi Object Pascal and built a working prototype of bound method references in order to understand their interaction with the Java programming language and its APIs. [...] Our conclusion was that bound method references are unnecessary and detrimental to the language. This decision was made in consultation with Borland International, who had previous experience with bound method references in Delphi Object Pascal." 
  3. ^ "The Java Language Environment". May 1996. http://java.sun.com/docs/white/langenv/Intro.doc1.html#943. 
  4. ^ "The Java Language Specification, 2nd Edition". http://java.sun.com/docs/books/jls/second_edition/html/intro.doc.html#237601. 
  5. ^ http://www.computerworld.com.au/index.php/id;1422447371;pp;3;fp;4194304;fpid;1
  6. ^ Patrick Naughton cites Objective-C as a strong influence on the design of the Java programming language, stating that notable direct derivatives include Java interfaces (derived from Objective-C's protocol) and primitive wrapper classes. [3]
  7. ^ TechMetrix Research (1999). "History of Java". Java Application Servers Report. http://www.fscript.org/prof/javapassport.pdf. "The project went ahead under the name "green" and the language was based on an old model of UCSD Pascal, which makes it possible to generate interpretive code" 
  8. ^ http://queue.acm.org/detail.cfm?id=1017013
  9. ^ "Programming Language Popularity". 2009. http://www.langpop.com/. Retrieved 2009-01-16. 
  10. ^ "TIOBE Programming Community Index". 2009. http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html. Retrieved 2009-05-06. 
  11. ^ Jon Byous, Java technology: The early years. Sun Developer Network, no date [ca. 1998]. Retrieved April 22, 2005.
  12. ^ http://blogs.sun.com/jonathan/entry/better_is_always_different.
  13. ^ Heinz Kabutz, Once Upon an Oak. Artima, Retrieved April 29, 2007.
  14. ^ Java Study Group; Why Java Was - Not - Standardized Twice; What is ECMA—and why Microsoft cares
  15. ^ Java Community Process website
  16. ^ open.itworld.com - JAVAONE: Sun - The bulk of Java is open sourced
  17. ^ "Sun’s Evolving Role as Java Evangelist". O'Reilly. http://onjava.com/pub/a/onjava/2002/04/17/evangelism.html. 
  18. ^ 1.2 Design Goals of the JavaTM Programming Language
  19. ^ Andy Patrizio (2006). "Sun Embraces Linux With New Java License". Internet News. Web Media Brands. http://www.internetnews.com/dev-news/article.php/3606656. Retrieved 2009-09-29. 
  20. ^ "Java for Mac OS X". Apple Developer Connection. Apple. http://developer.apple.com/java/. Retrieved 2009-09-29. 
  21. ^ http://www.microsoft.com/mscorp/java/default.mspx
  22. ^ Java SE - Licensees
  23. ^ James Niccolai (January 23, 2001). "Sun, Microsoft settle Java lawsuit". JavaWorld (IDG). http://www.javaworld.com/javaworld/jw-01-2001/jw-0124-iw-mssuncourt.html. Retrieved 2008-07-09. 
  24. ^ Jelovic, Dejan. "Why Java Will Always Be Slower than C++". http://www.jelovic.com/articles/why_java_is_slow.htm. Retrieved 2008-02-15. 
  25. ^ "Symantec's Just-In-Time Java Compiler To Be Integrated Into Sun JDK 1.1". http://www.symantec.com/about/news/release/article.jsp?prid=19970407_03. 
  26. ^ "Apple Licenses Symantec's Just In Time (JIT) Compiler To Accelerate Mac OS Runtime For Java". http://findarticles.com/p/articles/mi_hb6676/is_/ai_n26150624. 
  27. ^ "Java gets four times faster with new Symantec just-in-time compiler". http://www.infoworld.com/cgi-bin/displayStory.pl?980416.ehjdk.htm. 
  28. ^ Official JStik Website
  29. ^ http://www.ajile.com/index.php?option=com_content&task=view&id=21&Itemid=28 aJile Systems Inc.
  30. ^ NullPointerException
  31. ^ Exceptions in Java
  32. ^ Using the applet Tag (The Java Tutorials > Deployment > Applets)
  33. ^ Deploying Applets in a Mixed-Browser Environment (The Java Tutorials > Deployment > Applets)

References

  • Jon Byous, Java technology: The early years. Sun Developer Network, no date [ca. 1998]. Retrieved April 22, 2005.
  • James Gosling, A brief history of the Green project. Java.net, no date [ca. Q1/1998]. Retrieved April 29, 2007.
  • James Gosling, Bill Joy, Guy Steele, and Gilad Bracha, The Java language specification, third edition. Addison-Wesley, 2005. ISBN 0-321-24678-0 (see also online edition of the specification).
  • Tim Lindholm and Frank Yellin. .The Java Virtual Machine specification, second edition.^ That is, % java -prof HelloWorld.class 14: The Java Virtual Machine and Byte Codes .
    • comp.lang.java FAQ 10 January 2010 20:48 UTC www.cafeaulait.org [Source type: FILTERED WITH BAYES]

    ^ The wrong thing about Java is the Virtual machine implementation.
    • "Java Is Dead, Long Live Java!" – The Future of Java | JAVA Developer's Journal 10 January 2010 20:48 UTC java.sys-con.com [Source type: General]

    ^ Java language and compiler; the Java Virtual Machine for running platform independent bytecode; the Java API frameworks of class libraries.
    • iPhone 2.0 SDK: Java on the iPhone? — RoughlyDrafted Magazine 10 January 2010 20:48 UTC www.roughlydrafted.com [Source type: FILTERED WITH BAYES]

    Addison-Wesley, 1999. ISBN 0-201-43294-3 (see also online edition of the specification).

External links


Simple English

Java is a programming language that can run on many different computers including mobile phones. It was created by Sun Microsystems and released in 1995. Small Java programs, called applets, usually run inside web browsers.

Java is not the same as JavaScript. JavaScript is a scripting language mainly used by web browsers.

Contents

Background

Java is object oriented. Java code looks a lot like C++ or C code.

Java can run on many different operating systems. This makes Java platform independent. Java does this by making the Java compiler turn code into Java bytecode instead of machine code. This means that when the program is executed, the Java Virtual Machine interprets the bytecode and translates it into machine code.

Platform

The Java platform refers to a group of software products from Sun Microsystems. The platform is used to develop and run Java programs. The platform includes the execution engine (called a Java Virtual Machine) that allows Java programs to do the same thing on different computer systems.

Types of Java

There are many types of Java programs which run differently:

  • Applet - can be put online (in web browsers).
  • Application - can only be run on the computer, cannot be put online.
  • Servlet - runs on a server and helps to display web pages.
  • Swing application - like an application, but can have a more graphical look.
  • ejb - an application for business purpose

Other websites


Citable sentences

Up to date as of December 29, 2010

Here are sentences from other pages on Java, which are similar to those in the above article.








Got something to say? Make a comment.
Your name
Your email address
Message