[2056] in java-interest
Returned mail: User unknown
daemon@ATHENA.MIT.EDU (Mail Delivery Subsystem)
Fri Sep 22 14:58:36 1995
Date: Fri, 22 Sep 95 09:25:13 EDT
From: Mailer-Daemon@IConNet.COM (Mail Delivery Subsystem)
To: <java-interest@java.sun.com>
----- Transcript of session follows -----
Connected to nextec.iconnet.com:
>>> RCPT To:<sharmolin@nextec>
<<< 550 <sharmolin@nextec>... User unknown
550 sharmolin@nextec... User unknown
----- Unsent message follows -----
Return-Path: <java-interest@java.sun.com>
Received: by overlord.IConNet.COM (4.1/SMI-4.1)
id AA00263; Fri, 22 Sep 95 09:25:13 EDT
Received: from nextec.iconnet.com(199.173.161.199) by overlord.IConNet.COM via smap (V1.3)
id sma000261; Fri Sep 22 09:24:45 1995
Received: from overlord.IConNet.COM by nextec. (5.x/SMI-SVR4)
id AA00700; Fri, 22 Sep 1995 09:27:50 -0400
Received: by overlord.IConNet.COM (4.1/SMI-4.1)
id AA00256; Fri, 22 Sep 95 09:24:43 EDT
Received: from mail.iconnet.com(199.173.161.113) by overlord.IConNet.COM via smap (V1.3)
id sma000252; Fri Sep 22 09:24:28 1995
Received: from cc:Mail by mail.IConNet.COM
id AA811788039; Fri, 22 Sep 95 09:40:31 EST
Date: Fri, 22 Sep 95 09:40:31 EST
From: java-interest@java.sun.com
Encoding: 1450 Text
Message-Id: <9508228117.AA811788039@mail.IConNet.COM>
To: java-interest-digest@java.sun.com
Subject: java-interest-digest V1 #180
Received: by ccmail from java.sun.com
From owner-java-interest-digest@java.sun.com
X-Envelope-From: owner-java-interest-digest@java.sun.com
Received: (from majordom@localhost) by java.sun.com (8.6.12/8.6.12) id SAA21752 for java-interest-digest-outgoing; Thu, 21 Sep 1995 18:20:58 -0700
Date: Thu, 21 Sep 1995 18:20:58 -0700
Message-Id: <199509220120.SAA21752@java.sun.com>
From: owner-java-interest-digest@java.sun.com
To: java-interest-digest@java.sun.com
Subject: java-interest-digest V1 #180
Reply-To: java-interest@java.sun.com
Errors-To: owner-java-interest-digest@java.sun.com
Precedence: bulk
X-Info: To unsubscribe, send 'unsubscribe' to java-interest-digest-request@java.sun.com
java-interest-digest Friday, 22 September 1995 Volume 01 : Number 180
In this issue:
Re> Simple awt Menu prgram
FAQ lists
Fixed coordinate placement of components
Re: NetScape and Java
Re: throws declataration in Java/beta
loading error
Re: Connecting w/IP Address
Re: Object level concurrency control.
----------------------------------------------------------------------
From: "Sid Conklin" <sid.conklin@nora.stanford.edu>
Date: 21 Sep 1995 13:59:00 -0700
Subject: Re> Simple awt Menu prgram
Sami's code had a few missing items: not adding the menu to the menubar; and
not casting the evt.target to a menuItem. Here is the modified code:
import java.awt.*;
public class MenuTest extends Frame {
public MenuTest() {
super("MenuTest"); // set the title of the frame
MenuBar mb = new MenuBar();
// add a simple menu
Menu m = new Menu("Numbers");
m.add(new MenuItem("one"));
m.add(new MenuItem("two"));
m.add(new MenuItem("three"));
// add a submenu
Menu submenu = new Menu("More Numbers");
submenu.add(new MenuItem("four"));
submenu.add(new MenuItem("five"));
m.add(submenu);
//add menu to menubar
mb.add(m);
setMenuBar(mb); // install this menu bar in the frame
resize(300, 300);
show();
}
public boolean handleEvent(Event evt) {
if ((evt.id == Event.ACTION_EVENT) && (evt.target instanceof MenuItem)){
System.out.println(((MenuItem)evt.target).getLabel());
return true;
}
return false;
}
public static void main(String args[]) {
new MenuTest();
}
}
Good luck,
Sid
Stanford University
------ From: java-interest@java.sun.com, Thu, Sep 21, 1995 ------
Here's a simple awt program that puts up a menubar and prints out the
contents of a menu item when selected. Compile it with javac and then
just run it as "java MenuTest":
import java.awt.*;
public class MenuTest extends Frame {
public MenuTest() {
super("MenuTest"); // set the title of the frame
MenuBar mb = new MenuBar();
// add a simple menu
Menu m = new Menu("Numbers");
m.add(new MenuItem("one"));
m.add(new MenuItem("two"));
m.add(new MenuItem("three"));
// add a submenu
Menu submenu = new Menu("More Numbers");
submenu.add(new MenuItem("four"));
submenu.add(new MenuItem("five"));
m.add(submenu);
setMenuBar(mb); // install this menu bar in the frame
resize(300, 300);
show();
}
public boolean handleEvent(Event evt) {
if ((evt.id == Event.ACTION_EVENT) && (evt.target instanceof MenuItem)){
System.out.println(evt.target.getLabel());
}
}
public static void main(String args[]) {
new MenuTest();
}
}
------------------------------
From: elharo@inch.com (Elliotte Rusty Harold)
Date: Thu, 21 Sep 1995 17:39:26 -0400
Subject: FAQ lists
- --============_-1400402931==_============
Content-Type: text/plain; charset="us-ascii"
Attached to this message are my preliminary passes at a java FAQ list and
tutorial. There's obviously a lot missing and undoubtedly many mistakes.
Your comments are appreciated. I suspect to have another revision aout
next Monday based on what I learned at javaday.
The files are HTML and should load straight into your favorite web browser.
I have not yet found a host site for these. The original one I picked
turned out to have serious security holes in their web server. If anyone
is able to offer a site for these files, please feel free to contact me.
At a minimum I'd need a standard UNIX shell account with no firewalls
getting in the way of my access. The ability to run cgi's and configure my
own httpd.conf (like with apache) would be a big plus.
Let me know what you think.
- --============_-1400402931==_============
Content-Type: text/plain; name="javafaq.html"; charset="us-ascii"
Content-Disposition: attachment; filename="javafaq.html"
<html>
<head>
<title>
The Coffee Pot
</title>
</head>
<body>
<h1>
Java FAQ list and Tutorial: a work in progress</h1>
This is the java FAQ
list. A
<a href="javatutorial.html">Java Tutorial</a> is being developed
as simultaneously as time permits.<P>
<UL>
<LI><A
HREF="javafaq.html#xtocid89800"><STRONG>What is
Java?</STRONG></A>
<UL>
<LI><A HREF="javafaq.html#xtocid89801"><EM>Doesn't
the World Wide Web have something to do with this?</EM></A>
<LI><A
HREF="javafaq.html#xtocid89802"><EM>What Platforms does Java run
on?</EM></A>
</UL>
<LI><A HREF="javafaq.html#xtocid89803"><STRONG>What
other Java Resources are available?</STRONG></A>
<UL>
<LI><A
HREF="javafaq.html#xtocid89804"><EM>Web Sites</EM></A>
<LI><A
HREF="javafaq.html#xtocid89805"><EM>Mailing Lists</EM></A>
<LI><A
HREF="javafaq.html#xtocid89806"><EM>Newsgroups</EM></A>
<LI><A
HREF="javafaq.html#xtocid89807"><EM>Books</EM></A>
<LI><A
HREF="javafaq.html#xtocid89808"><EM>Training</EM></A>
</UL>
<LI><A
HREF="javafaq.html#xtocid89809"><STRONG>How Do
I...</STRONG></A>
<UL>
<LI><A HREF="javafaq.html#xtocid898010"><EM>Make a
linked list without pointers?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898011"><EM>Read data from a file?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898012"><EM>Write data to a file?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898013"><EM>Call C Code from java?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898014"><EM>Call Java from C?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898015"><EM>How do you do multiple
inheritance?</EM></A>
<LI><A HREF="javafaq.html#xtocid898016"><EM>Alright,
what's an interface?</EM></A>
</UL>
<LI><A
HREF="javafaq.html#xtocid898017"><STRONG>Language
Issues</STRONG></A>
<UL>
<LI><A HREF="javafaq.html#xtocid898018"><EM>How do
I version a class?</EM></A>
<LI><A HREF="javafaq.html#xtocid898019"><EM>Why
isn't there operator overloading?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898020"><EM>Does java pass function arguments by
value or by reference?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898021"><EM>What does it mean that a class is
"final"?</EM></A>
<LI><A HREF="javafaq.html#xtocid898022"><EM>Are
there parameterized types?</EM></A>
</UL>
<LI><A
HREF="javafaq.html#xtocid898023"><STRONG>Tools</STRONG></A>
<UL>
<LI><A
HREF="javafaq.html#xtocid898024"><EM>IDE</EM></A>
<LI><A
HREF="javafaq.html#xtocid898025"><EM>Debugger</EM></A>
<LI><A
HREF="javafaq.html#xtocid898026"><EM>Editors</EM></A>
<LI><A
HREF="javafaq.html#xtocid898027"><EM>YACC grammar?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898028"><EM>Profilers</EM></A>
</UL>
<LI><A
HREF="javafaq.html#xtocid898029"><STRONG>Optimizing
Java</STRONG></A>
<LI><A HREF="javafaq.html#xtocid898030"><STRONG>Legal
Issues</STRONG></A>
<LI><A HREF="javafaq.html#xtocid898031"><STRONG>FAQ's
about the FAQ</STRONG></A>
<UL>
<LI><A
HREF="javafaq.html#xtocid898032"><EM>Who is this Elliotte guy, and just
what qualified him to write a java FAQ anyway?</EM></A>
<LI><A
HREF="javafaq.html#xtocid898033"><EM>Why don't you include X in your
FAQ?</EM></A>
<LI><A HREF="javafaq.html#xtocid898034"><EM>This is really
cool. Can I republish it?</EM></A>
</UL>
</UL>
<h2><A
NAME="xtocid89800">What is Java?</A></h2>
Java, formerly known as oak, is
an object-oriented programming language
developed by Sun. It shares many
superficial similarities with C, C++, and
Objective C (for instance for
loops have the same syntax in all four languages);
but it is not based on
any of those languages, nor have efforts
been made to make it compatible
with them.<P>
Java is sometimes referred to as C++--. The language was
originally created
because C++ proved inadequate for certain tasks. Since
the designers were
not burdened with compatibility with existing languages
they were able to
learn from the experience and mistakes of previous
object-oriented languages.
Thus features that had proved to be more
troublesome thn valuable like
multiple inheritance and operator overloading
were thrown out.<P>
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. This required
the elimination of more
features of C and C++. Most notably there are no
pointers in java. Java
programs cannot (at least in theory) access
arbitrary addresses in memory.<P>
Furthermore java was designed to not
only be cross-platform in source form like
C, but also in compiled binary
form. Since this is frankly impossible across
processor architecttures java
is compiled to an intermediate byte-code which
is interpreted on the fly by
the java interpreter. Thus to port java programs
to a new platform all
that is really needed is to port the interpreter.<P>
<h3><A
NAME="xtocid89801">Doesn't the World Wide Web have something to do with
this?</A></h3>
Not necessarily. Java is a programming language. When work
began on what has
become java, the World Wide Web was just getting started
at CERN and Mosaic
wasn't even a glint in Marc Andreesen's eye. The
original
use of the java language (settop boxes) required security and the
ability
to execute code from untrusted hosts. It turns out these are
virtually the
same requirements for allowing people to download and run
programs from the Web.
No other language has the built-in security of
java. The key here are the
the security features. The object-oriented
nature of java is secondary, and
mainly reflects the preferences and
prejudices of the developers who set
out to write a secure language. The
C-like syntax of the language is even
less important to the problem.<P>
At the lowest level the
advantage of java to the web is that it provides
a secure, cross-platform
way for code to be executed. At a somewhat
higher level java adds several features to
exisitng web sites:<P>
<dl>
<dt>Arbitrary Graphics
<dd>
Java lets the server draw pictures in a
window on the client.
In theory this allows a web page to do anything a
regular program can
do by drawing in a window. <P>
<dt>Arbitrary Data
Types
<dd>
In practice rather than using graphics primitives to create
your desired web page
you'd use a graphics program to draw the page and
then write a program that
could read and display the file formats of that
program. Java lets
you write content-handlers that display any particualr
data format.
This way you can download your data and your data display
program rather
than downloading a bitmapped snapshot of the
display. People are already using
this to add sound and animation to web
pages. Rather than having to download a file
and spawn an external
viewer, the viewer is included with the data; and the
data is displayed
right on the page.<P>
<dt>Less Load on the server
<dd>
CPU intensive
cgi-bin scripts place a large load on a server,
particularly at busy
sites. With java you can offload the actual
calculations to the client's
PC. I've written an applet
that calculates all possible ram
configurations for a given
Mac model. However on models with many memory
slots the
sheer number of permutations can tie up even a fast machine
for
several hours. Publishing this a as cgi-bin would bring
my server to its
knees, but by pblishing it as a java applet I can distribute the load
across all the machines that want to run it.<P>
<dt>More user
Interaction
<dd>
Finally java allows for more interaction with the user.
Java not only
allows you to paint arbitray data on the screen. It also
allows you
to collect input from the user in the form of mouse clicks,
keystrokes and the like. This lets you put almost any application
on your
web page that doesn't require disk access.<P>
</dl>
<h3><A
NAME="xtocid89802">What Platforms does Java run on?</A></h3>
Java is
currently available for Sparc Solaris, Windows NT for Intel, and Windows
95.
Sun is porting java to MacOS 7.5, but it is unclear when this port will
ship.
IBM is porting java to OS/2.
Ports are underway for Linux, HP-UX and
possibly other platforms.<P>
No ports are currently planned for Windows
3.x or SunOS 4.x.<P>
In the past and likely in the future, new versions of
java have been made available first
for Solaris. Source code
is available
only for Solaris. If you have to the latest
version as soon as it's
released, or if you're developing "Bet your company"
applications with
java you need to be running Solaris on a SparcStation.
Otherwise, if you
just want to learn the language, you can get away with
an Intel based
Windows 95 or NT machine with a lot of RAM.<P>
<h2><A
NAME="xtocid89803">What other Java Resources are
available?</A></h2>
<h3><A NAME="xtocid89804">Web Sites</A></h3>
The key
site for java information is <a
href="http://java.sun.com">http://java.sun.com</a>.
This is Sun's official
site for java, and contains the latest
published version of all official
java information. As of this writing this is the only
web site with any
worthwhile information about the details of java (including this
one).<P>
This site has grown quite busy and is mirrored in several other
places including <P>
<ul>
<li>Dimension X (San Francisco,California, USA):
<a href=http://www.dnx.com/java/>http://www.dnx.com/java/</a>
<li>Central
Europe SunSITE: <a
href=http://sunsite.informatik.rwth-aachen.de/Mirror/java/>http://sunsite.in
formatik.rwth-aachen.de/Mirror/java/</a>
<li>Lulea University, Sweden: <a
href=http://www.cdt.luth.se/java>http://www.cdt.luth.se/java/</a>
</ul>
The
documentation at this site is not well organized
and is not particularly
easy to find when you need
it. It's not uncommon to find something
once
and then lose track of it when you go back. Here are the most important
pages:<P>
<dl>
<dt><a href="http://java.sun.com/documentation.html">The
Documentation Page</a>
<dd>
The most important page on this site is the
Documentation page at
<a
href="http://java.sun.com/documentation.html">
http://java.sun.com/documenta
tion.html</a>. Most of the others
pages are linked off of this page or its
children.<P>
<dt> <a
href="http://java.sun.com/progGuide/index.html"><i>Trail Map:
Java/HotJava
Programmer's Guide</i></a>
<dd>
The beginnings of a java tutorial.
<P>
<dt><a href="http://java.sun.com/1.0alpha3/doc/index.html">
The
complete set of documentation for the 1.0alpha3 release</a>
<dd>
This is
the same documentation included with the browser with maybe a
few minor
corrections. It's useful to have in your hot list when
you're not using
HotJava.<P>
<dt><a
href="http://java.sun.com/1.0alpha3/doc/javaspec/javaspec_1.html>
The Java
Language Specification</a>
<dd>This is to java as Kernighan and Ritchie is
to C. Note, however, that since java
is an object oriented language much
of its functionality is tied up in the class library
and is not present in
the language itself.<P>
<dt><a
href="http://java.sun.com/1.0alpha3/doc/api/packages.html">The Java Class
API</a>
<dd>
This is as to java as P.J. Plaugher is to C, only more
so.<P>
<dt><a
href="http://www.sun.com/sunworldonline/swol-07-1995/swol-07-java.html">Java
, The Inside Story</a>
<dd>
This is the first article about the genesis and
history of Java.
You may also be interested in Chris Warth's
<a
href="http://java.sun.com/archives/./java-interest/0585.html>
comments
about the article.</a><P>
<DT>Java at Yahoo
<DD>As usual Yahoo has fairly
useful collections of links to java info.<P>
<UL>
<LI>Java:<br>
<A
Href="http://www.yahoo.com/Computers/Languages/Java/">
http://www.yahoo.com/Computers/Languages/Java/</A>.
<LI>HotJava Browser:
<br>
<A
Href="http://www.yahoo.com/Computers_and_Internet/Internet/World_Wide_Web/Br
owsers/HotJava/">
http://www.yahoo.com/Computers_and_Internet/Internet/World_Wide_Web/Browsers
/HotJava</A>.
</UL>
<P>
<DT><A
Href="http://rendezvous.com/java/hierarchy/index.html">
Java Class
Hierarchy Diagrams</A>
<DD>
Charles L. Perkins has prepared a
number of diagrams which show the class hierarchy
for Java packages.
These are in PostScript format.
<P>
<dt><a
href="http://www.rpi.edu/~decemj/works/java/bib.html">The Java Online
Bibliography</a>
<dd>
General, non-technical articles about Java on the
Web<P>
<dt><A Href="http://www.science.wayne.edu/~joey/java.html">
The Wild, Wild World of HotJava</A>
<dd>
Various news about java and
hotjava, mostly non-technical,
compiled by Joey Oravec.<P>
<dt><a
href="http://g.oswego.edu/dl/pats/aopintro.html">Programming Active Objects
in Java</a>
<dd>
Doug Lea's explication of the philosophy of active object
design using java as the implementing
language.<P>
</dl>
<h3><A
NAME="xtocid89805">Mailing Lists</A></h3>
There are several java related
mailing lists. Complete details are available
at <a
href="http://java.sun.com/mail.html">http://java.sun.com/mail.html</a>.
<P>
<dl>
<dt> java-announce
<dd>
A moderated list with announcements of
interest to java users. If you
want to know when the Mac version is
released subscribe to this list.
Please don't bother asking on the other
lists.<P>
<dt>hotjava-interest
<dd>
For discussion of the HotJava browser.
This list has very little <em>useful</em>
traffic. Almost all posts here
are pointless cross-posts from java-interest.<P>
<dt>
java-interest
<dd>
Discussion of the java language.<P>
<dt>
java-porting
<dd>
Porting java to other platforms.<P>
<P>
</ul>
Digest
versions of java-interest, java-porting and hotjava-interest are
available
as java-interest-digest, java-porting-digest and
hotjava-interest-digest.
To subscribe to any or all of these lists send
the word "subscribe"
in the <stroong>BODY</strong> of a mail
message to
<i>listname-request@java.sun.com</i>, where listname the mailing
list
you want to subscribe to.<P>
<a
href="http://java.sun.com/archives/index.html">HyperMail archives</a>
of
these lists are also available.<P>
When you send email to these lists
<strong>never, never</strong> cross-post.
If you can't decide where your
message properly belongs flip a coin. Please
don't send it to
every
single list.<P>
<h3><A
NAME="xtocid89806">Newsgroups</A></h3>
<dl>
<dt><a
href="news:alt.www.hotjava">alt.www.hotjava</a>
<dd>
The java-interest and
hotjava-interest mailing lists are
gated into this newsgroup, but not the
other way around.
<P>
<dt><a
href="news:comp.lang.java">comp.lang.java</a>
<dd>
alt.www.java's
replacement. It does not yet appear to have been created
but expect it
soon.<P>
</dl>
<h3><A NAME="xtocid89807">Books</A></h3>
<dl>
<dt><a
href="http://www.mcp.com/samsnet/track1/HOTPRESS/whatsnew.html">Presenting
Java
An Introduction to the Java Language and HotJava Browser</a>
<dd>
by
<A HREF="http://www.rpi.edu/~decemj/">John December</A>
<ul>
<li>Publisher:
<a href="http://www.mcp.com/">SAMS.net</a>, a division of <a
href="http://www.mcp.com">MacMillan Computer Publishing</a>
<li>ISBN:
1-57521-039-8<BR>
<li>Publication Date: September 20, 1995<BR>
<li>224
pages
<li>$25.00<BR>
<li>Orders: (800) 428-5331
<li><A
HREF="http://www.mcp.com/samsnet/track1/HOTPRESS/ejvtoc.html">Table of
Contents</A>
<li><A
HREF="http://www.mcp.com/samsnet/track1/HOTPRESS/ejvintro.html">Introduction
</A>
<li>Support Web: <A
href="http://www.rpi.edu/~decemj/works/java.html">http://www.rpi.edu/~decemj
/works/java.html</A>
</ul>
<P>
An initial peek at the <a
href="http://www.mcp.com/samsnet/track1/HOTPRESS/ejvtoc.html">Table of
Contents</a> indicates to me that <i>Presenting Java</i>
is very heavy on
the philosophy and purpose of java and very light on
practical information.
It certainly doesn't have very much information to help
you learn to
program in java.<P>
</dl>
<P>
<a href="http://www.mcp.com/que">Que
Books</a> is also rumored to have two java books in development
but I have
no information about them at this time.<P>
<h3><A
NAME="xtocid89808">Training</A></h3>
Sun sponsors a series on java in
several California locations including
Mountainview, Pleasanton and
Sacramento. Details are available
at <a
href="http://www.entexcal.com/sunsacramento/java/">http://www.entexcal.com/s
unsacramento/java/</a>. Be warned that this page includes several
ridiculously large graphics. You should probably turn off autoloading of
images before you hit this page. This site also has some notes
and example
programs from the training sessions.<P>
<h2><A NAME="xtocid89809">How Do
I...</A></h2>
<h3><A NAME="xtocid898010">Make a linked listwithout
pointers?</A></h3>
Use the <a
href="http://java.sun.com/1.0alpha3/doc/api/java.util.Vector.html">vector
class</a>
in java.lang.util.<P>
<h3><A NAME="xtocid898011">Read data from
a file?</A></h3>
<h3><A NAME="xtocid898012">Write data to a
file?</A></h3>
<h3><A NAME="xtocid898013">Call C Code from
java?</A></h3>
First of all for security reasons you can only call
external code from an application.
You cannot call external code from an
applet. (Otherwise all the security would go out
the window.)<P>
<h3><A
NAME="xtocid898014">Call Java from C?</A></h3>
<h3><A
NAME="xtocid898015">How do you do multiple inheritance?</A></h3>
Use
interfaces.<P>
<h3><A NAME="xtocid898016">Alright, what's an
interface?</A></h3>
An interface is an idea taken from Objective C. It
describes the public methods that a class implements and their
calling
conventions without saying <em>anything</em> about how those methods are
implemented.<P>
<h2><A NAME="xtocid898017">Language
Issues</A></h2>
<h3><A NAME="xtocid898018">How do I version a
class?</A></h3>
You don't. There is no support for versioning classes in
java nor is there
likely to be in the near future. A solution to this
problem will probably
have to wait for the next object oriented language
which will learn from
java's mistakes as java has learned from
C++'s.<P>
<h3><A NAME="xtocid898019">Why isn't there operator
overloading?</A></h3>
Because C++ has proven by example that operator
overloading makes code
almost impossible to maintain.<P>
<h3><A
NAME="xtocid898020">Does java pass function arguments by value or by
reference?</A></h3>
By reference.<P>
<h3><A NAME="xtocid898021">What does
it mean that a class is "final"?</A></h3>
A final class can no
longer be subclassed. Mostly this is done for security
reasons with basic
classes like String and Integer. It also allows the compiler
to make some
small optimizations.<P>
<h3><A NAME="xtocid898022">Are there parameterized
types?</A></h3>
Not in the first iteration of the language. However this
is being seriously
considered for future versions.<P>
<h2><A
NAME="xtocid898023">Tools</A></h2>
<h3><A
NAME="xtocid898024">IDE</A></h3>
There is currently no IDE for java. Sun
has hinted that they will release a
payware IDE with the final release
version sometime in the first quarter of 1996.<P>
<h3><A
NAME="xtocid898025">Debugger</A></h3>
<h3><A
NAME="xtocid898026">Editors</A></h3>
An emacs mode for java is available
at <a
href="ftp://java.sun.com/pub/java/contrib/emacs/">ftp://java.sun.com/pub/jav
a/contrib/emacs/</a>
<P>
<h3><A NAME="xtocid898027">YACC
grammar?</A></h3>
Scott Hudson has written an LALR grammar for Java. You
can ftp it from
<a
href="ftp://ftp.cc.gatech.edu/people/hudson/java_grammar/">ftp://ftp.cc.gate
ch.edu/people/hudson/java_grammar/</a>
<h3><A
NAME="xtocid898028">Profilers</A></h3>
javaprof<P>
<h2><A
NAME="xtocid898029">Optimizing Java</A></h2>
<ol>
<li>Make your classes
final.
<li>Use the -O flag to the compiler.
<li>If you're reading data off
a disk read it in as large a chunk as possible.
Do not read it a byte at a
time. If you need to process the data a byte at a time
read it into a
temporary buffer first.<P>
</ol>
<P>
<h2><A NAME="xtocid898030">Legal
Issues</A></h2>
Some portions of java and hotjava are neither in the
public domain nor
copylefted. No license is required to write and
distribute most java
applications and applets. A license from Sun may be
required if you want to distribute
the java runtime interpreter or write a
java compiler.
More than that I do not know at this time. <P>
<h2><A
NAME="xtocid898031">FAQ's about the FAQ</A></h2>
<h3><A
NAME="xtocid898032">Who is this Elliotte guy, and just what qualified him
to write a java FAQ anyway?</A></h3>
He was willing to do it. Seriously
months on the java mailing lists made
it obvious that a FAQ was needed and
since none seemed to be forthcoming
from those more qualified than I, I
boldly and with a complete disregard for
my absolute lack of qualifications
stepped forward and volunteered.
I do have some hopethat my previous
experience with FAQ lists, the world wide web
and a variety of programming
languages may somehow cover up the fact that
I have no idea what I'm doing.
You've read the FAQ list by now. Did I succeed?<P>
Why am I taking on
such a Herculean task? It's often said that you never
really understand a
subject until you teach it. I'm going to endeavor
to learn java and
understand it by teaching it. The result should be
interesting at least.
Since I'm very new to java and clearly do not
yet understand the language,
I'll have a perspective on the issues that should be
helpful to
newcomers.<P>
Are there mistakes here? Absolutely. I hope people here and
elsewhere
will correct me gently and help lead me on the path to true java
enlightenment when I err. And if they aren't so gentle, well, I've
developed a
pretty thick skin after five years of Usenet.<P>
My companion
tutorial in how
to write java is going to reflect the programs I'm
actually writing.
As I learn to do a Hello World program, I'll write about
Hello World.
(OK, I've actually already gotten beyond Hello World but not
much
beyond.) How fast the FAQ list grows will depend in large part on
how fast my
skills grow. You'll get to watch me learn, make mistakes,
correct
mistakes and so on. <P>
There may be an advantage to this
approach. People who want to learn
java will be coming from almost
identical places as me. I always
hate having to write down or talk down to
people and I don't do it
very well. Similarly I find it frustrating to try
to communicate with
people who are way beyond me (as obviously some people
on the java mailing lists
are). Right now I am at the level of the lowest
of the low. This
means that I can write for people without much prior
experience
without boring myself or, hopefully, my audience, to
tears.<P>
Finally I'll emphasize that I'm not trying to prevent anyone
else or
any other team of people from taking on a similar project. I hope
someone does. I'll probably learn from what they do, and they'll learn
from
what I do, even if it's only to learn the sorts of things novices are
confused about. And of course not everyone shares the same learning
style
so while some people may enjoy my approach to java I am sure
others will
find it dense, incoherent and ultimately
incomprehensible. More choices
are better.<P>
Ultimately I'm doing this because I think java is very,
very cool and
I am convinced I need to learn it sooner rather than later.
I think
this project will propel my java knowledge forward, and if it does
that I'll consider my project a success. If I can help a few other
lost
sould to climb out of the pit with me at the same time, so much
the
better.<P>
<h3><A NAME="xtocid898033">Why don't you include X in your
FAQ?</A></h3>
Please do make suggestions about topics for FAQ list
inclusion.
You can email them to <a
href="mailto:elharo@inch.com">elharo@inch.com</a>.
I do follow the
java-interest mailing list religiously, and have
a pretty good idea of
what's discussed there. However I don't necessarily
understand all the
conversations that take place on it. I am not a java genius,
at least not
yet, and a FAQ is far more likely to be included here if you
propose not
only a question but also an answer. Please be as clear and explicit
with
your answer as possible so that even someone with as small a brain as I
can
understand it. Thank you.<P>
<h3><A NAME="xtocid898034">This is really
cool. Can I republish it?</A></h3>
This FAQ list and its entire contents
are copyright 1995 by Elliotte Rusty Harold.
If you have specific desires
to republish it in whole or part contact me at <a
href="mailto:elharo@inch.com">elharo@inch.com</a> and tell me exactly what
you want to
do. I'm generally receptive to non-profits that want to make
it available to the public
at no charge and to anyone who's willing to make
reasonable payment arrangments.<P>
<hr>
Copyright 1995 <a
href="http://www.macfaq.com/personal.html">Elliotte Rusty Harold</a>
<br>
<a href="mailto:elharo@inch.com">elharo@inch.com</a><br>
Last Modified
September 20, 1995
</body>
</html>
- --============_-1400402931==_============
Content-Type: text/plain; name="javatutorial.html"; charset="us-ascii"
Content-Disposition: attachment; filename="javatutorial.html"
<html>
<head>
<title>
Brewing Java: A Tutorial
</title>
</head>
<body>
<h1> Brewing Java: A Tutorial
</h1>
This is a java
tutorial in progress. A
<a href="javafaq.html">Java FAQ list</a> is being
developed
as simultaneously as time permits.<P>
<h2><A
NAME="xtocid88420">Table of Contents</A></h2>
<UL>
<LI><A
HREF="javatutorial.html#xtocid88420"><STRONG>Table of
Contents</STRONG></A>
<LI><A
HREF="javatutorial.html#xtocid88421"><STRONG>Hello World: The
Application</STRONG></A>
<LI><A
HREF="javatutorial.html#xtocid88422"><STRONG>Hello World: The
Applet</STRONG></A>
<LI><A HREF="javatutorial.html#xtocid88423"><STRONG>Ram
Config: The Application</STRONG></A>
<LI><A
HREF="javatutorial.html#xtocid88424"><STRONG>Ram Config: The
Applet</STRONG></A>
<LI><A HREF="javatutorial.html#xtocid88425"><STRONG>A
setext to HTML converter</STRONG></A>
<LI><A
HREF="javatutorial.html#xtocid88426"><STRONG>Writing CGI's in
Java</STRONG></A>
<LI><A HREF="javatutorial.html#xtocid88427"><STRONG>Java
Wizards</STRONG></A>
</UL>
<h2><A NAME="xtocid88421">Hello World: The
Application</A></h2>
It's customary in programming to begin with the
"Hello World"
program, a program that prints the string
"Hello World" to the
display. Not one to defy tradition we begin
similarly.<P>
The following is the Hello World Application as written in
java.
Type it into a text file or copy it out of your web browser, and save
it
as a file named hello.java. (Special Directory?)<P>
To compile this
program you need to type "javac hello" at the command prompt.
If
there are no errors, you can then run the program by typing "java
hello"
at the command prompt.<P>
<pre>
<code>
class HelloWorld {
public static void main (String args[]) {
System.out.println("Hello
World");
}
}
</code>
</pre>
<i>Hello World</i> is very close to the
simplest program imaginable.
Although it doesn't teach very much from a
programming standpoint,
it gives you a chance to learn the mechanics of
writing and compiling code.
If you're like me your first effort won't
compile, especially if you
typed it in from scratch rather than copying and
pasting. Here are
are a few common beginner mistakes: <P>
<oL>
<li> Did
you put a semicolon after <code>System.out.println("Hello
World")</code>?
<li> Did you include the closing bracket?
</ol>
<P>
Once
your program has compiled succesfully you can run it by typing "java
HelloWorld".
Assuming there are no further errors you the system will
then print "Hello World"
on your screen.<P>
Now let's look at
the program a little more closely. The first thing to note is that
all the
action takes place inside a class, in this case the HelloWorld class. In
java
almost everything of interest is a class. Even basic data primitives
like integers
often need to be cast into classes. The class is the
fundamental unit of java programs,
not source code files like in C. For
instance consider the following java program:<P>
<pre>
<code>
class
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!");
}
}
</code>
</pre>
The second class is a completely
independent program. Once you've compiled it type
java GoodbyeWorld and
then type java HelloWorld. These programs run and execute independently of
each other although they exist in the same source code file. Off the top
of my head I can't think of why you might want two separate programs in the
same file, but if you do the capbility is there.<P>
<h2><A
NAME="xtocid88422">Hello World: The Applet</A></h2>
In this tutorial I'm
primarily endeavoring to teach (and learn)
the java programming language.
Thus a lot of the initial examples
are going to concentrate on java
applications that run
from a command line interface. However the reason
people
are excited about java as more than just another OOP language is
because
of the way it allows one to write interactive applets on theweb.
<i
>Hello World</i> isn't a very interactive program, but let's look
at a
webbed version.<P>
The following example is taken from <a
href="http://java.sun.com/faq2.html#o6">Sun's Java FAQ
list.</a><P>
<pre>
<code>
import HotJava.Applet;
import
awt.Graphics;
class HelloWorld extends Applet {
public void init() {
resize(150, 25);
}
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
}
</code>
</pre>
<h2><A NAME="xtocid88423">Ram Config: The
Application</A></h2>
<h2><A NAME="xtocid88424">Ram Config: The
Applet</A></h2>
<h2><A NAME="xtocid88425">A setext to HTML
converter</A></h2>
<h2><A NAME="xtocid88426">Writing CGI's in
Java</A></h2>
<h2><A NAME="xtocid88427">Java
Wizards</A></h2>
<hr>
Copyright 1995 <a
href="http://www.macfaq.com/personal.html">Elliotte Rusty Harold</a>
<br>
<a href="mailto:elharo@inch.com">elharo@inch.com</a><br>
Last
Modified September 15, 1995
</body>
</html>
- --============_-1400402931==_============
Content-Type: text/plain; charset="us-ascii"
Elliotte Rusty Harold
elharo@shock.njit.edu
webmaster@nymug.org
elharo@inch.com
- --============_-1400402931==_============--
------------------------------
From: "Sid Conklin" <sid.conklin@nora.stanford.edu>
Date: 21 Sep 1995 15:15:55 -0700
Subject: Fixed coordinate placement of components
How do you add components to a Window/Frame/Panel so they go in exact
(x,y,width,height)? Do I have to have a layout manager? It seems that all
containers default to a layout manager that doesn't allow for fixed
coordinate placement of GUI elements. Is there a schematic showing the
relationship between containers/components.
Thanks,
Sid Conklin
Stanford University
------------------------------
From: Ben Black <benb@velocity.com>
Date: Thu, 21 Sep 95 17:19:50 -0500
Subject: Re: NetScape and Java
>To do that, the system has to be very simple to use and relatively
>indestructable. Something like an XWindows terminal for JAVA.
>
X-Windoze simple and indestructable? i want some of what he's smoking!
ben
------------------------------
From: Michael Lorton <mlorton@eshop.com>
Date: Thu, 21 Sep 1995 16:22:12 -0700
Subject: Re: throws declataration in Java/beta
> Another thing you cannot do is ask for the current thread to sleep
> when you are in the run method because the interface Runnable does not
> specify "throws InterruptedException"... I am sure there are lots of
> other such examples. JC
You can, but you must personally catch the InterruptedException (that
way it cannot be return).
I think...
M.
------------------------------
From: Jeffrey Tseng <jtseng@graphics.cornell.edu>
Date: Thu, 21 Sep 95 21:19:13 EDT
Subject: loading error
I'm sorry if this question as been asked many times - I have been reading for
a couple weeks.
I have written a few classes, but kept them all in the same file. One of
the classes extends Applet, but the others don't. When I try to use HotJava
to load the class file, it gives me an Access Exception error, and says that
an "applet has attempted to read ...filename.class"
I'm using the alpha3 release on NT, and have gotten other single class applets
to work.
Any help would be greatly appreciated.
- - Jeff
------------------------------
From: "guy.elliott" <guy.elliott@ac.com>
Date: 21 Sep 95 18:16:29
Subject: Re: Connecting w/IP Address
Geoff,
This happens to me as well, and I filed a bug on it. The quick and easy
solution that I came up with was to use the Hosts and LMHosts files to turn the
IP address into a name. HotJava seems to like that and works fine.
Hope this helps
Guy
Andersen Consulting
------------------------------
From: Larry Reu <larryr@CyberGate.COM>
Date: Thu, 21 Sep 1995 18:21:15 -0700 (PDT)
Subject: Re: Object level concurrency control.
On Thu, 21 Sep 1995, Leon Hurst wrote:
> Seen as Java is both multithreaded and Object Oriented I was wondering
> if there was any object level concurrency control available or in the
> works. For example can one specify a set of methods as "serialised",
> meaning that only one of these methods can be executing at a time.
>
indeed methods (or blocks of code) can be marked "synchronized" which
means theat method aquires a lock before executing. Each object (i.e.
instance of a class) has one lock and each class has a lock. Thus static
synchronized methods aquire the class lock non statics aquire the class
lock. (page 19 of 11may95 lang spec).
.........later........larry
------------------------------
End of java-interest-digest V1 #180
***********************************
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com