D
Don Bruder
Let's start right from start, ala "12 step" meetings...
Hi, I'm Don, and I'm a serious greenie when it comes to Java.
(This is the part where you all say "Hi Don! Glad to have you here!")
"How serious,", you ask? Well, in the past 3-4 days, I've done a
"power-skim" of a "Learn Java on the Mac" book that came in PDF format
on my DE's install disk, I've got some code to look at/play with, and
I've been playing around in it for the last 2-3 days, give or take,
trying to get a feel for the language.
I come from a fairly extensive programming background - multiple
flavors of BASIC, 6502/65C02 assembler, 8086 assembler, Turbo and UCSD
Pascal, FORTRAN, COBOL, and a handful of others, including some serious
weirdos that are more for the sake of being able to say "I can (or
could at one time) code in _____" than any practical purpose. For the
past couple-four years, I've been doing my thing almost exclusively in
C, with a *VERY* minor foot-wetting in C++, and recently a foray into
Python that pretty much left me shaking my head and asking "Why
mistreat a computer that way?!?!?" (Not much different from my reaction
to its namesake TV program, if you want the truth) The list isn't to
brag, it's simply to put across the fact that I'm *NOT* a newbie to
coding, only to coding *in Java*.
So far, the PDF/book I'm using as a reference is serving me well, and
where it's lacking, my own programming experience is doing a reasonable
job of filling in the few blanks. However, I've encountered something
that the book doesn't address (although there is a tantalizing hint,
more in a moment) and nothing in my knowledge base can be safely
applied, since it's obviously something that's going to have its own
special Java meaning. To save newsgroup space, I've trimmed all the
guts out of the method involved (a constructor, I believe, is the
proper terminology in this case, no?), leaving only the parts that have
me puzzled:
/* Trimmage - lots of "import this.that.and.the.other" lines */
public class StartServer extends Thread {
/* Bunch of instance vars and several methods of class StartServer
elided */
public StartServer() {
super("Start Server"); /* This line is the one that's got me
scratching my head */
try {
/* bunch more eliding here */
} /* end of class StartServer, elide rest of file */
The calling/invoking/instantiating/whatever-you-wanna-call-it-ing
snippet:
public class Main {
/* Several irrelevant chunks of class Main that
obviously do "the boring stuff" elided */
public static StartServer start = null;
public static void main(String[] args) {
/* elide some self-explanatory stuff - instance vars and some setup work
*/
start = new StartServer(); /* There it is... */
/* elide the rest */
The hint the book drops:
Inheritance and discussion of the concept of extending, rather than
flat-out overriding, the behavior of a class and its methods talks
about prepending "super." to the method name, which will have the
effect of invoking both the instantiation's version of the method, AND
the parent object's version of the method.
That's all well and good, but it doesn't QUITE manage to touch on what
I'm looking at. Or does it? I can't help but think that it's at least
related somehow...
I can't figure out what the "super("Start Server");" invocation is
invoking. As *I* understand the languageso far, there's a
"period-something" missing between the end of "super" and the "(", so
it doesn't parse to anything sensible to me.
At no time does "super()" appear to be declared/defined/instantiated,
or anything-elsed by anything in the source code. Which makes me think
it must be one of two things: a special notation that I haven't learned
about yet, or a method that's hiding in one of the
java.something.something "library" packages that get imported every
which way but loose.
Obviously, I've missed something relatively important.
Anybody wanna spray-paint it flourescent green and hand me a
black-light?
Hi, I'm Don, and I'm a serious greenie when it comes to Java.
(This is the part where you all say "Hi Don! Glad to have you here!")
"How serious,", you ask? Well, in the past 3-4 days, I've done a
"power-skim" of a "Learn Java on the Mac" book that came in PDF format
on my DE's install disk, I've got some code to look at/play with, and
I've been playing around in it for the last 2-3 days, give or take,
trying to get a feel for the language.
I come from a fairly extensive programming background - multiple
flavors of BASIC, 6502/65C02 assembler, 8086 assembler, Turbo and UCSD
Pascal, FORTRAN, COBOL, and a handful of others, including some serious
weirdos that are more for the sake of being able to say "I can (or
could at one time) code in _____" than any practical purpose. For the
past couple-four years, I've been doing my thing almost exclusively in
C, with a *VERY* minor foot-wetting in C++, and recently a foray into
Python that pretty much left me shaking my head and asking "Why
mistreat a computer that way?!?!?" (Not much different from my reaction
to its namesake TV program, if you want the truth) The list isn't to
brag, it's simply to put across the fact that I'm *NOT* a newbie to
coding, only to coding *in Java*.
So far, the PDF/book I'm using as a reference is serving me well, and
where it's lacking, my own programming experience is doing a reasonable
job of filling in the few blanks. However, I've encountered something
that the book doesn't address (although there is a tantalizing hint,
more in a moment) and nothing in my knowledge base can be safely
applied, since it's obviously something that's going to have its own
special Java meaning. To save newsgroup space, I've trimmed all the
guts out of the method involved (a constructor, I believe, is the
proper terminology in this case, no?), leaving only the parts that have
me puzzled:
/* Trimmage - lots of "import this.that.and.the.other" lines */
public class StartServer extends Thread {
/* Bunch of instance vars and several methods of class StartServer
elided */
public StartServer() {
super("Start Server"); /* This line is the one that's got me
scratching my head */
try {
/* bunch more eliding here */
} /* end of class StartServer, elide rest of file */
The calling/invoking/instantiating/whatever-you-wanna-call-it-ing
snippet:
public class Main {
/* Several irrelevant chunks of class Main that
obviously do "the boring stuff" elided */
public static StartServer start = null;
public static void main(String[] args) {
/* elide some self-explanatory stuff - instance vars and some setup work
*/
start = new StartServer(); /* There it is... */
/* elide the rest */
The hint the book drops:
Inheritance and discussion of the concept of extending, rather than
flat-out overriding, the behavior of a class and its methods talks
about prepending "super." to the method name, which will have the
effect of invoking both the instantiation's version of the method, AND
the parent object's version of the method.
That's all well and good, but it doesn't QUITE manage to touch on what
I'm looking at. Or does it? I can't help but think that it's at least
related somehow...
I can't figure out what the "super("Start Server");" invocation is
invoking. As *I* understand the languageso far, there's a
"period-something" missing between the end of "super" and the "(", so
it doesn't parse to anything sensible to me.
At no time does "super()" appear to be declared/defined/instantiated,
or anything-elsed by anything in the source code. Which makes me think
it must be one of two things: a special notation that I haven't learned
about yet, or a method that's hiding in one of the
java.something.something "library" packages that get imported every
which way but loose.
Obviously, I've missed something relatively important.
Anybody wanna spray-paint it flourescent green and hand me a
black-light?