[1193] in java-interest
Answers to a bunch of questions.
daemon@ATHENA.MIT.EDU (Jonathan Payne)
Fri Aug 25 16:43:49 1995
Date: Fri, 25 Aug 1995 09:38:20 -0700
From: jpayne@starwave.com (Jonathan Payne)
To: java-interest@java.Eng.Sun.COM
I can't bear the thought of having peoples' questions go unanswered.
But I am too busy to be distracted by mail coming in ever few minutes.
Therefore I am getting the digest versions now. But then answering
questions is too hard because I have to manually cut and paste
addresses and bodies of messages. Therefore, I am going to try an
experiment to see if I can answer them all at once in a single huge
message.
Let me know if this is a big mistake.
------------------------------
From: "Henri BROUCHOUD - FT.CNET/LAA/EIA/AIA" <brouchou@lannion.cnet.fr>
Date: Mon, 21 Aug 1995 17:55:15 +0200
Subject: Naive question
Hello all,
It seems that the javac compiler produces one .class file for each
defined class. Is it possible to package several classes in only
one .class file ? If I am writting an application with a lot of
classes, I dont want to deliver such a bunch of dozens of files
...
No, this is not possible. But multiple class delivery is a general
problem with a simple solution, and somebody even posted a solution to
these groups a while ago. Unfortunately, it's only useful if it is
adopted by the Java team.
------------------------------
From: Edith Au <edith@pencom.com>
Date: Mon, 21 Aug 1995 17:47:55 -0400 (EDT)
Subject: Which is the best way to find the class of a method?
Hi there,
I am new to the OO programming and I am learning it through
reading other people's codes. I spend a lot of time on finding
which class does a method come from. For example:
import java.*;
import awt.*;
import browser.*;
class new_class extends Applet implements Runnable
{
.....
public void start()
{
repaint();
}
....
}
How do I know where repaint come from?
Since you can't textually see the method in your code, and since it's
a method on the current object, you know it must be defined by one of
your superclasses. In this case your class extends Applet, so the
method must be defined in Applet or one of its superclasses. In this
case, it happens to be defined in Applet.
------------------------------
From: neil@bedford.progress.COM (Neil Galarneau)
Date: Mon, 21 Aug 95 14:00:07 EDT
Subject: java access to persistent data/data base?
I am looking for a way for my java program to store data between
java sessions.
I don't care if it is a database or some kind of object
persistence or whatnot.
I just don't want to have to do it all by hand.
What is available?
Nothing. Except some very basic helper classes called DataInputStream
and DataOutputStream. They allow you to read and write binary data in
a machine indedendent format. No, that's not much.
------------------------------
From: David.Geary@Central.Sun.COM (David Geary)
Date: Mon, 21 Aug 1995 09:12:07 +0700
Subject: Re: what is wrong with an answer that has C++ sucks in it?
> From daemon@java Sat Aug 19 22:24 MDT 1995
> If you're happy with C++, bully for you.
>
[ list of Java features elided ]
> I know Java isn't the only language that has these (and other)
> features. In fact, Java really only invented a couple new approaches
> to problems. And C++ might even have a few of these features as well.
> The reason "C++ sucks" is a reasonable answer is that (1) it sucks,
Ah, that explains it.
I'm sorry. I thought the list of features that you deleted was a good
start in the direction of why C++ sucks.
> (2) most people doing object oriented programming are doing it in C++
> and not liking it. The nicest thing I have ever heard said about C++
> is that it's better than C.
Well, let's see. I'm doing C++ development with Rogue Wave's Tools.h++
and ViewKit's Motif Application Framework.
Will life be much better for me if I move to Java? Will I have
access to a robust and well tested/documented class library like
Tools.h++? Will I have a host of application frameworks to choose
from that simplify my life from a GUI perspective?
No. So I guess you better stick with your tools until Java gets
enough libraries written so that the answer is yes. Obviously Java
hasn't been around long enough, and the 10 or so Java hackers at Sun
don't have enough time, to have built all these class libraries.
C++'s main strength seems to be the mountains of code already written
for C++. But writing and debugging that code was probably not fun.
I'm still trying to find out the answers to these and other questions.
It's interesting to me that _nobody_ has answered my inquiry into the
'suitability of Java for developing standalone apps', while everyone seems
intent to flame C++.
I could have sworn I have answered this question several times. Maybe
my answer isn't sophisticated enough for you. To me the answer is
Yes. Java was not designed to write applets on the web. Java was
designed to have characteristics suitable for applications like web
applications, but was also designed to be a systems language. The
Java compiler is a nice standalone app if you ask me. Written several
times, in several different ways, by Arthur in just three months is a
testimonial to the language itself, and Arthur's abilities of course.
The original HotJava browser, all the networking classes, and the
first generation of the windows toolkit, were whipped together in a
couple of weeks. And not a single moment of time was spent chasing
down segfaults.
------------------------------
From: rbk@ibeam.jf.intel.com (Bob Beck)
Date: Wed, 23 Aug 95 13:46:13 Pacific Daylight Time--100
Subject: Additional "standardized" collection classes?
Are there going to be additional "standardized" collection classes
in later alpha's, the beta, or FCS of Java?
I would like there to be an official mechanism for getting useful
classes as part of the standard Java release. I have no idea how such
things have worked in the past with other languages. How many people
have written Queue objects, timer events, etc.?
------------------------------
From: sshinder@adobe.com (Scot Shinderman)
Date: Tue, 22 Aug 1995 15:38:25 -0700
Subject: My first day -- some questions...
After programming java for one whole day I have run across a couple of
problems that I can't answer with the online help.
Most of these questions relate to packages and the naming rules that they
inspire. Is there a set of docs about this?
If I add the single line:
package test;
then I can no longer run a java program on the command line -- it says:
Can't find class Steam.
I guess it's changing the name of the class.
Yes, the name of the class is "test.Steam". If you need to access
that class from another class in a different package, then you import
it:
import test.Steam;
If you are defining a class in the same package, all other classes in
that package are automatically imported for you.
Also, how do i get one class to use another when both are
mine.. for example...
[Example deleted]
compiling tells me that Class Pooh not found in type declaration.
This should work. Make sure "." is in your classpath (or your
classpath is null, in which case it defaults to "."). Make sure there
are no package statements that you have forgotten about.
------------------------------
From: ibalkhi@dnt.dialog.com (Imran Balkhi (NT))
Date: Wed, 23 Aug 1995 17:08:03 -0700
Subject: Passing Object base class as a parameter
Hi,
I tried to pass Object base class as a parameter to a native
function. However, java compiler could not find Object class. I am
providing java code and error message. Please if somebody has any
idea please let me know.
Note: I was able to pass user defined classes as parameter to
native function.
// Java Code
class Reg {
public static native long regC(Object xx); // Create a shadow object
public static native long unregC(Object yy); // Delete a shadow objec
}
//Error Message
final.java:5: Class object not found in type declaration.
public static native long regC(object xx); // Create a shadow object
^
final.java:6: Class object not found in type declaration.
public static native long unregC(object yy); // Delete a shadow objec
^
Your code fragments say "Object" and your error messages say "object".
Class names are case-sensitive.
------------------------------
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com