.Open The Java Programming Language .As_is http://www.csci.csusb.edu/dick/samples/java.html This page is designed to be a step by step introduction to Java for a competent C++ programmer. Getting your first Java programs to run is unusually hard because .Net Names of files have to precisely match the identifiers used inside the files. Names of classes in Applets must match the names of classes in Java. It is hard to keep all these names in synchronization as the code develops. Some books do not follow the newer scoping rules. .Close.Net Beginners can work through the .See Overview section below to make this process less painful. This page also has many links to more in depth information about Java. .Open Overview $Java is designed to be a completely object-oriented programming language used in consumer appliances like VCRs and toasters. It is based on the first version of C++ but explicitly leaves out features of C and C++ that are confusing or unreliable. It has inheritance and dynamic polymorphism but not generics and/or templates. It is designed with concurrent programming in mind. It has most of the expressions and control structures of C plus $exceptions but without the "go to". So a C++ programer finds Java programs easy to read but verbose. It is slightly more work to write, but the result is nearly always clearer than the abbreviated C++ code. Java is compiled into a special machine code that is then interpreted. Java code does not perform as fast as C++. The interpreter however protects the machine on which it is running from errors that can break operating systems in C++. Furhter the same (compiled) code can run on many different systems: Compile-Once-Run-Anywhere. So a Java program can be transmitted across a network to a machine of a different type, with a different operating system, and different graphic user interface. There it will run safely and securely (in theory) and look-and-feel as if it was programmed for that system. Doing this with C++ is extremely expensive. $Java can be used to write `applications` and `applets`. A $Java $application is similar to any other high-level language program: It can only be compiled and then run on the same machine. An $applet is compiled on one machine, stored on a server in binary, and can be sent to a another machine over the Internet to be interpretted by a Java-aware browser. Java comes with a large library of ready made classes and objects. The key difference betwen Java 1.0 and 1.1 was in this library. - the $AWT. Similarly, Java 2.0 has a very much larger library for handling user interfaces (Swing by name) but only small changes to the core of the language. .Open Applications An application is compiled (using $javac) and run like any other program but it is actually a Java $class that contains a special method called 'main'. When the interpreter ($java) is called with the name of the $class, it looks for the `public static main(String[])` $function in the $class and calls it. . Example Application The following is based on the old traditional C program that prints "Hello, World" on the computer screen: (Hello): .Box .As_is import java.lang.*; .As_is public class Hello { .As_is public static void main(String argv[]){ .As_is System.out.println("Hello, World!"); .As_is } .As_is } .Close.Box The above is best put in a file called `Hello.java` .See http://ftp.csci.csusb.edu/public/faculty/dick/Hello.java and then compiled with 'javac Hello.java' and then run: 'java Hello'. The `import` statement in a Java file allow it to refer to other classes in other files and directories. The compiler uses these other classes's definitions to check your code, and the interpreter loads the binary bytecode into the running program. The word $public means that the thing following it can be accessed by anyone. A public class can be imported over the internet into any other class and so can be sent to a browser. A public function can be called by statements and expressions in different classes. $static indicates that a function or object belongs to the $class rather than to each individual $object in the $class. The function is called like this 'Hello.main(...)' even when there are no objects constructed in class Hello. Notice that Java code was designed to be interpreted by a machine independent `virtual` machine ($JVM) that runs a special machine code called $bytecode. .Close Applications . Tools The $Hello application would be compiled like this: .As_is javac Hello.java and run by the java interpreter like this: .As_is java Hello Notice that the `file` "Hello.java" is compiled, but a `$class` is interpreted. One nice feature of the Sun $JDK is the documentation tool $javadoc. The above application $Hello has the following documentation: .See http://ftp.csci.csusb.edu/public/faculty/dick/Hello.html which was generated by $javadoc. $javadoc scans source code files (*.java) and creates one HTML file per $class in the files. Classes and parts of classes can have special documentary comments (starting "/**" ) added to them that are reformatted and incorporated into the Hypertext produced by `javadoc`. This should be a boon for realistic projects. The full syntax of the special comments can be found at .See http://www/dick/samples/java.syntax.html#Doc_Comment on this web site. The `javap` program disassembles bytecode (*.class files) and outputs a description of the what is in them. .Open Applets An `Applet` is a small program that can be sent across the Internet and interpreted on a client machine. To give permission for remote access it must be a $public $class. Typically it is a class that inherits and/or defines a special set of functions needed to run an $applet. These are part of the $class $Applet. So all Java applets are $public classes that $extend $Applet. You can not run a Java applet unless it is also an application or you have a WWW page that refers to it. The page needs HTML like the following to call the compiled code, in the same directory: .As_is .As_is Alternate text .As_is where `h` and `w` are the HEIGHT and WIDTH of the box in which the applet outputs its response. The `alternate text` appears when a browser can not handle APPLETs. For the general syntax see $applet_in_html. The code in "ClassName.class" above, is the result of compiling a file called "ClassName.java" that contains a $public $class called `ClassName` which $extends an $Applet. (For details on HTML see .See http://www/dick/doc/www.html written in the HyperText Markup Language(HTML) .See http://www/dick/samples/comp.html.syntax.html. ) . Example Here is a suitable piece of HTML to test a simple $HelloWorld class: .As_is Test .As_is .As_is You can not see this brilliant Java Applet. .As_is .As_is Put this in a file called: .As_is test.HelloWorld.html The code for the $HelloWorld applet has to be a $public $class called "HelloWorld" that extends $Applet and is in in a Java file called: .As_is HelloWorld.java Here is the Java code: (HelloWorld): .Box .As_is import java.applet.*; .As_is import java.awt.*; .As_is public class HelloWorld extends Applet { .As_is public void init() { .As_is resize(150,25); .As_is }//init .As_is public void paint(Graphics g) { .As_is g.setFont(new Font("Helvetica", Font.PLAIN, 8)); .As_is g.drawString("Hello world!", 50, 25); .As_is }//paint .As_is }//HelloWorld .Close.Box The Applet is compiled just like any other program: .As_is javac HelloWorld.java This will generate a set of files with extension/suffix ".class". Notice that the compiler forces you to name the file "HelloWorld.java", the Class "HelloWorld", and generates the binary $bytecode in a file called "HelloWorld.class". Sun has written a special program to test applets in page: .As_is appletviewer test.HelloWorld.html However you can not use 'java' to run the $HelloWorld $class - it has no 'main'. Neither can 'java' "run" the WWW pages like the `test.HelloWorld.html` file. On the Suns in the Sun lab you can tell 'Netscape' to "Open local File..." and select .As_is test.HelloWorld.html but using the older Netscape to debug an applet has some $problems indicated later. . Public Classes and Pages The moment a .class file or a package becomes public on the web, other Java classes, anywhere on the web, can "import" your public classes and use them to construct more classes! Normally you should put applet code (compiled and source) in the same directory as the public page that refers to them. This is simple and works. There are more complicated ways of organizing the files. It is said that if the page is in directory with path name `D` on the server and your operating system uses `S` to separate directories in path names .As_is ( S.DOS=`\`, S.UNIX=`/`, S.Mac=`:`) then the applet code for $class `C` must be in directory `D``S`classes and have a name `C`.class. However Netscape 2.01 for Suns looks in directory `D`, unless you add the attribute `CODEBASE=classes` to the Applet tag. There is also an interaction between `packages` and subdirectories that goes beyong the basic knowledge covered here. . Debugging Problems with Browsers (problems): .Set You may have to change the options/properties of your browser to be able to run Java. This is a security issue. Your browser must trust the compiler you use. If it doesnot recognize the compiler version (hidden in the compiled file) it may reject the applet. To be sure of a browser finding all the necessary $class files they have to be in the same directory as the pages that refer to them. You can not keep the $bytecode .class file private and the page public. To put .class files in a subdirectory you may have to place them in a $package with the same name as well. If the Applet fails, use the Options menu to open the Java Console... and look for errors. The Older Netscape running in background does not make a good development tool because it is hard to make the program reload the code of Applets. You can change the code, recompile it, publish all the files perfectly, `and` hit the reload button in Netscape and it will not reload the new $bytecode. I've wasted hours looking for bugs that I've fixed. Instead use Sun's $appletviewer and/or debuggers. You can also include a main function in applets that make them applications. See .See Applications Can Run Applets next. If it is absolutely necessary to debug the applet inside an html page then (1) use the Sun Appletviewer, (2) find a machine with Netscape 4.0 and use Shift+Reload, or (3) execute Netscape directly on a local copy of the page and Exit from it before working on the applet code. In vi you can use something like this: .As_is :!java % .As_is :!netscape test.page.name.html to suspend the editor and run Netscape on the test page. Exit Netacape and tap Return/Enter to continue editting. On Orion, if you use `Q` to compile a program `Stuff`.java and you have a readable file called test.`Stuff`.java then it will automagically execute netscape for you. This is in Beta -- EMail `dick` if you don't like it. .Close.Set . Applications Can Run Applets The 'java' interpreter can run classes that have an appropriate 'main' $function: .As_is java classname This special $method or $function is called `main`. To run an applet it must create a window and run the applet in it. The steps are: .Box Create a new window to display the applet. Create a new object of the correct $class. Tell the applet to initialize itself. Tell the applet to start running. Add the running applet into the window. Resize the window. Show the window to you. .Close.Box Please use the following sample as a model for your own testing: (applet_test_harness): .As_is private final static int SIZE = 300;//size of window .As_is .As_is public static void main(String args[]) { .As_is .As_is HelloWorld aHelloWorldObject = new HelloWorld(); .As_is //The aHelloWorld object exists .As_is .As_is aHelloWorldObject.init(); .As_is //aHelloWorld has now initialized it self .As_is aHelloWorldObject.start(); .As_is //aHelloWorld has now started running .As_is .As_is Frame aWindow = new Frame("HelloWorld"); .As_is //A window called "HelloWorld" will hold the Applet .As_is .As_is aWindow.add("Center", aHelloWorldObject); .As_is //aWindow now has aHelloWorld in it's center .As_is aWindow.resize(SIZE, SIZE); .As_is aWindow.show(); .As_is //aWindow is now shown to you (until you CTRL/C) .As_is .As_is }//main You can download an uptodate working copy of the HelloWorld $class which is both an applications and and applet from .See http://ftp.csci.csusb.edu/public/faculty/dick/HelloWorld.java Keep a copy of this and use it generate your own test programs for applets.... before you put them on the Web! I have just developed a new tool that will generate an HTML test page for a new $applet and also a suitable *.java file ready for the details to be filled in It is in .See http://ftp.csci.csusb.edu/public/faculty/dick/instantapplet Please download and try out -- Beta Testing. . Another Example There is a more elaborate example of a Java applet/application program in .See http://ftp.csci.csusb.edu/public/faculty/dick/test.Goodbye.html complete with links to the source code, documentation, and byte code. It also shows how to control fonts and colors of text. . Caveat Here is a warning: The above main programs do not create a complete environment created by a browser looking at an HTML page. The Applet can not access the parameters that can be encoded in the page. Neither can they find out about the width and height encoded in the tag. .Close Applets . Summary .Table To get write this .Row Application: public class `C` ... { ... public static void main(String[])...} .Row Applet: import java.applet.*; .... public class `C` extends Applet ... { ... } .Close.Table .Table .Row A class with name `C` .Row is best put in a file `C`.java .Row and compiled by javac `C`.java .Row producing Bytecode `C`.class .Row executed by java `C` `arguments` .Row and documented by javadoc `C`.java .Row producing `C`.html .Close.Table .Close Overview .Open Glossary Also see .See http://www/dick/samples/java.glossary.html abstract::$methods=`A method that must exist for objects in a $class but is fully defined only in subclasses`, -- an abstract method can not be private, final, native, or synchronized. abstract::$classes=`A $class with one or more abstract methods`. Applet::$AWT=`Class of objects that are embedded in an $HTML page and initialized and run by a browser over the $WWW` applet::=`A small program that can be sent across a network and interpreted safely on the receiving machine`. application::Java=`A $class that defines a public static $void main(String args[]) method` AWT::=awt. awt::=`Abstract windowing toolkit, another windowing toolkit. A set of machine independent classes that make it easier to create graphic user interfaces and output`. bytecode::= .See byte_code. byte_code::=`a way of describing classes as a stream of byte oriented machine code for the Java Virtual Machine`. classes::=plural of $class. class::=`A set of objects with similar behaviors and intelligence. A $class defines a collection of knowledge and know how. Classes are defined by declaring variables and and functions.`. .See http://www/dick/samples/objects.glossary.html#class constant::=`any $final $field` -- a piece of data about an object or class that can not be varied once it is initialized. concurrency::=`faking multiple processors so that the programmer can pretend that many processes or threads are executing at one time and interacting together`. .See http://www/dick/samples/java.syntax.html#Synchronized_statement extends::=`indicates that a new $class has all the properties of the class it extends`. In Java all classes ultimately extend the $class Object. exception::=`a way of exitting gracefully from expressions and statements when something unusual occurs`, .See http://www/dick/samples/java.syntax.html#Try_block .See http://www/dick/samples/java.syntax.html#Throw_statement exceptions::=`plural of $exception`. field::java=`A $variable or $constant associated with a $class or $object - a piece of data or knowledge that that object knows about and controls`. file::=`A collection of data. A Java source code file defines one or more classes, interfaces that is placed in a particular package`. final::$modifier=`a final $class can not be extended, a final variable can not have its value changed, and a final $function can not be overridden`. function::computing=`A named piece of code that returns a value and may also do something` function::java=`A piece of know-how attached to a $class or accessed via an object` ISO::="International Standards Organization". implements::=`indicates that a $class defines all the public functions listed in an $interface`. interface::=`The way that something is accessed from outside. The parts of an object that are shared with the clients that use that object`. interface::java=`A collection of $abstract $public $function headers that can be implemented in different ways by different classes, and extended to give more interfaces.`. interface::=`Describes a set of classes in terms of what they can do for you, but allows each $class to implement these methods in any way that you wish`. Java::=A language developed by Sun for developing software that is distributed over the Internet to special purpose hardware like a thermostat or (latterly) to browsers via the $WWW. JDK::=`Java Development Kit( compiler=> javac, interpreter=> java, classes=> $AWT`. JVM::=`Java Virtual Machine`, the $virtual_machine provides the operational semantics of $Java and so defines the hardware+software environment needed to run Java $bytecode. methods::=plural of $method. method::=`A piece of "know-how". A $procedure or $function that is associated with an object or a $class`. modifier::=$public | $static | $final | $private | $protected | $abstract | ..., a word placed in front of a declaration that changes its semantics. object::=`An instance of a $class`, in $Java an object is always handled via a reference that is created by the 'new' operation and a constructor and can be assigned to $field of that $class. procedure::ComputerScience=`A named piece of code that does something for a caller'. procedure::java=`a $void $function`. public::$modifier=`indicates that a $class, $field, or $function can be used by anything and anywhere on the internet`. private::$modifier=`indicates that a $class, $field, or $function can only be used locally inside a $class`. protected::$modifier=`A degree of hiding lie between $public and $private, subclasses and classes in the same $package have access to these items`. -- unwise since any class can claim to be a member of the same package! (Thanks to Andrew for correcting this definition) private_protected::$modifier="deprecated in 1.5". package::=`a collection of classes, encode as files in a common directory, that has the same name as the package and are allowed special access privileges`. The default scope/access for a function or class is to its package. If no package is declared at the start of a file then the classes etc belong in the deafult global package. static::=`something associated with a $class rather than an $object`. variable::java=`A piece of knowledge associated with a $class or an object. Any non-$final $field`. virtual_machine::=`A hypothetical machine that can be emulated on many different actual machines`. void::=`word used in place of a type to indicate that a $function does not return a value`. -- introduced in ANSI C and still confusing people 10 years later. WWW::="World Wide Web". URL::="Universal Resource Locator'. Also see .See http://www/dick/samples/java.glossary.html .Close Glossary .Open Syntax . Introduction The syntax of Java is close to C++ but a lot more verbose. syntax::=http://www.csci.csusb.edu/dick/samples/java.syntax.html. In outline a java file starts with an optional package declaration and some import statements: .As_is package whatever; .As_is import package.subpackage.....class .As_is import package.subpackage.* These are followed by a sequence of class and interface declarations: .As_is modifiers name extends class possible_interfaces{ .As_is field and function definitions .As_is } Field definitions have two forms: .As_is modifiers type name; and .As_is modifiers type name = initial value; where a `type` is either a classname or a simple data type like 'int' or 'char' or 'double'. If the modifiers include 'final' then the $field is a $constant, othewise it is a $variable. The following is a very common and useful type of declaration: .As_is modifiers type name = new type(arguments); Arrays are declared like this: .As_is modifiers type name[] = new type[size]; You can omit the initializer -- and `name` will be NIL! .As_is modifiers type name[]; The array must not be used until it is initialised in a staement like this: .As_is name = new type[size]; In either case, if the 'type' is a class(like Object or Applet), the individual objects must be constructed and put in the array before they are used. .As_is name[0] = new type; .As_is name[1] = new type; perhaps. Function definitions have form .As_is modifiers return_type name(arguments){ .As_is local definitions and statemants .As_is } the `return_type` above is "void" or the name of a class or simple data type. $modifiers are listed in the glossary. In older Java only variables (fields) can be defined as local. Statements have following main forms: .As_is variable.function_name(arguments)...; .As_is class.function_name(arguments)...; .As_is variable = expression; .As_is while(expression) statement .As_is if(expression) statement .As_is if(expression) statement else statement Expressions are typical arithmetic, relational, conditional, expressions of C or C++ plus .As_is variable.function_name(arguments)...; .As_is class.function_name(arguments)...; Java allows you to declare local variables and constants inside a function. You can declare a new variable or constant at any place in a function but you can not define the same identifier in different blocks. This causes a common error with for statements like this: .As_is for(int i=0; i that contains the script inside the page. It was invented by Netscape to allow people to write programs to generate pages dynamically. Javascript programs are placed in between tags in the HTML page and they are executed as the oage is loaded by the user's Browser. They can also be attached to buttons on a page. Javascript was once called LiveScript. It is beeing standardized by ECMA (European Standards...) as ECMAScript. Meanwhile MicroSoft has produced its own version called JScript! Even Netscape has 3 or 4 versions of Javascript. The common syntactic ancestor (C++) with Java is clear but the details are quite different to Java. The semantics is closer to Smalltalk than anything else. Both Java and Javascript let you produce more complex pages. Both Java and Javascript run on the user's system. A CGI .See http://www/dick/samples/comp.html.syntax.html#CGI is executed on the server and sends the results to the client. Pointers to news and Google groups: .See news:comp.lang.javascript .Open Specification of Java . Standardization $ISO was involved in co-ordinating the development of a standard specification of Java. $ISO granted Sun the privilege of proposing a "fast-track" standard. When Sun realized that they would lose control of the Java Specification as a result they backed off. Microsoft would prefer its own version of Java and libraries to be the standard. 10,000 developers who want Java's to be a cross-platform language have formed the `Java Lobby`. Sun sued MicroSoft for abusing its licence of Java by giving out a version that will work with only MicroSoft software rather than on all platforms. So far(Winter 1998-1999) Microsoft has been ordered to stop giving out their polluted version and have been forced to distribute an upgrade to the "Pure Java" version. Now MicroSoft is promoting .NET and C# as rival tecnologies to Java. . Other Specifications There is a short glossary of the terms used in Java .See http://www/dick/samples/java.glossary.html in my local samples of formal documentation. The syntax (1.0alpha) is summarized at .See http://www/dick/samples/java.syntax.html in my documentation samples. Java has its semantics defined by a compiler that translates the Java source code for a virtual machine (the JVM), There is a detailed specification of the virtual machine. My own notes on Java semantics are under construction .See http://www/dick/samples/java.semantics.html in my documentation samples. (File Formats): A specification of the format of a .class file was held at http://www.javasoft.com/1.0alpha3/doc/vmspec/vmspec_38.html but I haven't found the replacement..... . Java Documentation (Java reference): Sun's reference site .See http://java.sun.com/reference/ (Java Specification): For the the Official Java(TM) 2 Platform, Standard Edition. .See http://java.sun.com/j2se/ API::="Application Programmers Interfaces". APIs::=http://java.sun.com/reference/api/index.html, and pick the version of Java that you are using. .Close Specification of Java .Open See Also .Open Information on the Java Language (online magazine): Focus on Java Technology Guide .See http://java.about.com/ hosted by William Wagers (FAQ): .See http://www.afu.com/javafaq.html .See http://www-net.com/java/faq .See http://sunsite.unc.edu/javafaq/javafaq.html .See http://sunsite.unc.edu/javafaq (News): .Set Archives: .See http://www/dick/java.www.sites.html .See http://www/dick/old.java.www.sites.html USENET NewGroups( searchable via Google Groups): .See news:comp.lang.java.announce , . . . .See news:comp.lang.java.security , . . . .See news:comp.lang.java.programmer , . . . .See news:comp.lang.java.tech , . . . .See news:comp.lang.java.misc , . . . .See news:comp.lang.java.advocacy , . . . .See news:comp.lang.java.setup , . . . .See news:comp.lang.java , . . . .See news:alt.www.hotjava , . . . .See news:comp.lang.javascript , . . . .See news:comp.compilers.tools.javacc , . . . .See news:comp.lang.java.corba: Magazines: Java Report .See http://www.sigs.com/jro , Java World .See http://www.javaworld.com/ , Pure Java Developer's Journal .See http://www.cobb.com/pjd/ .Close.Set (Samples): local: .See http://ftp.csci.csusb.edu/public/faculty/dick/ remote: .See http://java.sun.com/applets/index.html .See http://members.tripod.com/~net_tools/free-counters.htm .See http://wwwipd.ira.uka.de/~espresso .See http://www.w3.org/pub/WWW/OOP/9606_Workshop/ .See http://www.iconcomp.com/demo/case-Phone/phoneCase.html .See http://www.bulletproof.com/wallstreetweb .See http://www-dse.doc.ic.ac.uk/~np2/spectrum/index.html .See http://www.inch.com/~friskel/ .See http://www.gamelan.com/ .See http://www.inmet.com/java.html/ .See http://www.best.com/~nessus/algintro.html .See http://mirage.irdu.nus.sg/javatutorial/java/index.html (Documentation): local: .See Glossary .See http://www.csci.csusb.edu/dick/samples/java.class.tree.html .See http://www.csci.csusb.edu/dick/samples/java.classes.html .See http://www.csci.csusb.edu/dick/samples/java.glossary.html .See http://www.csci.csusb.edu/dick/samples/java.html .See http://www.csci.csusb.edu/dick/samples/java.lang.System.html .See http://www.csci.csusb.edu/dick/samples/java.packages.html .See http://www.csci.csusb.edu/dick/samples/java.semantics.html .See http://www.csci.csusb.edu/dick/samples/java.syntax.html .See http://www.csci.csusb.edu/dick/samples/java.www.sites.html .See See Also remote: .See http://java.sun.com/ = .See http://www.applets.com/ , . . . For more general information see the Java and HotJava Documentation .See http://java.dnx.com/documentation.html and in particular the goals of Java .See http://java.dnx.com/1.0alpha3/doc/overview/java/index.html and the Java Tutorial at Sun.com .See http://java.sun.com/tutorial/ A programmer's guide: .See http://java.dnx.com/progGuide/index.html .Close Pointers to WWW information on the Java Language . The Source Code . News and Announcements .See http://www.cnet.com/Content/News/ The Java announcements archive .See http://wuarchive.wustl.edu/packages/java/ plus my local archives of announcements: .See http://www/dick/java.www.sites.html (after July 29th 1996) .See http://www/dick/old.java.www.sites.html (before July 29th 1996) The Java Newbie FAQs from Usenet comp.lang.java: .See ftp://www.csci.csusb.edu/doc/java.newbie.FAQ Elliotte Rusty Harold's Official Frequently Asked Questions .See http://sunsite.unc.edu/javafaq/javafaq.html. Also see TeamJAVA .See http://www.teamjava.com:80/links/ and HowDoI at Digital Focus: .See http://www.digitalfocus.com/digitalfocus/faq/howdoi.html Also see Earthweb's Java Directory on www.Gamelan.com .See http://www.gamelan.com/ I culled a few common questions and answers in .See http://www/dick/samples/java.FAQ but these are very rough and ready as yet, and not official FAQs for Java. Also see the uneditted version: .See http://www/dick/samples/java.mbox USENET NewsGroups(also on Google groups) (newsgroups): (computer Language): .See news:comp.lang.java.announce .See news:comp.lang.java.security .See news:comp.lang.java.programmer .See news:comp.lang.java.tech .See news:comp.lang.java.misc .See news:comp.lang.java.advocacy .See news:comp.lang.java.setup .See news:comp.lang.java.corba .See news:comp.lang.java (Setting the class path):java .See http://java.sun.com/products/jdk/1.2/docs/tooldocs/solaris/classpath-linux.html (tools): .See news:alt.www.hotjava .See news:comp.compilers.tools.javacc . Tutorials Locally: Under redevelopment. At Fairfield: .See http://funrsc.fairfield.edu/program/java/java.html Marty Hall's Tutorials .See http://www.apl.jhu.edu/~hall/java/#Tutorials . Books Errata for "Java in 21 Days" .See http://www.lne.com/Web/Books/Java/errata.html Examples etc for "Java in a Nutshell" .See ftp://ftp.ora.com/published/oreilly/nutshell/java/ Local information on objects in general .See http://www/dick/samples/objects.html , . . . information on language including Java .See http://www/dick/languages.html#Java , . . . and notes and links about software engineering in general .See http://www/dick/se.www.sites.html . Source Code Examples .See http://www.Planet-Source-Code.com/PlanetSourceCode/ .Close See also . Trivia (CAFEBABE): On UNIX a compiled $class can be recognized because it will contain a magic string of bytes that spell out in hexadecimal `0xCAFEBABE`. . The Naming of Java Some think it means "Just Another Vague Acronym". The name "Java" is not an acronym. The original name was "Oak", after the tree outside the developers window, but it turned out that "Oak" was already copyrighted/trademarked/in-use. The descriptions of the next stage vary but all indicate some kind of brainstorming session and/or a local coffee shop, during which name "Java" was proposed and accepted. .Close The Java Programming Language