Re: Learning Java - How should I go about it?



On Thu, 28 Apr 2005, amethyst wrote:

> I borrowed the book "Java - How to Program, 3e, Deitel & Deitel"
> from my local library. But it didn't come with a CD. This book
> is a tutorial for Java 2, using Java 2 SDK v1.2.1 with either
> NetBeans dev. x2 2.1 or JBuilder 3 University Ed.

Deitel & Deitel is not a bad book. A little dated. A lot has changed since
this book was published. You might want to get a book that covers at least
1.3.1. If you are looking to work for someone else you will find that some
people are still using 1.3.1 to 1.4.2.

There is a free tutorial at http://java.sun.com. You can also download all
the J2SE JDKs from here as well.

> I couldn't find that old IDE software so I installed JDK 1.5
> with netbeans from the Sun site.

I would have gone with NetBeans 4.1 and JDK 1.4.2 but that is just me. A
lot of the 'new' features of 1.5 might cause you to create code that will
not run on 1.4 or 1.3. You can always get a 1.4.2 program to work on a 1.5
JVM.

> The problem is that the very first program example in the Deitel
> book now fails on me.
>
> + + + + + + +
> public class Welcome1
> {
> public static void main(String args[])
> {
> System.out.println ("Welcome to java Mark");
> }
> }
> + + + + + + +
> The last line in the next section gives the error I got from the
> command line:
> + + + + + + +
> // Directory of D:\_java\Deitel
> // Welcome.java 302 bytes
> // D:\_java\Deitel>java Welcome1.java
> // Exception in thread "main" java.lang.NoClassDefFoundError:
> Welcome1/java

You have to compile the Java code into p-code then run the p-code. This
means you need to do:

javac Welcome1.java
java Welcome1

The first command will turn Welcome1.java into Welcome1.class. The second
command will find and run the Welcome1.class code.

> + + + + + + +
>
> I've already programmed in other languages COBOL, Pascal, VB,
> Java Script and have gone through C# without actually doing
> anything in it.
>
> Should I persevere with the Deitel book?

It would not hurt. A lot of the features in 1.2 are still in 1.5 but I'm
not sure how heavily the book will go through Swing. JDK 1.1 used AWT to
program GUI. Today people tend to use Swing to program GUI.

> Is this initial problem I'm having with the java command line
> not too important and should I just continue with the other
> examples using the IDE?

If something in the book does not work as expected you should find out why
before moving on. It could be you misread something, the book has a
typographical error, the book is just wrong, your environment is not set
up correctly, etc. Without knowing why you had the failure you will not
know if you are doing the right thing.

> The Deitel book looks a bit tedious. Can someone recommend a
> book that covers all of java without spending too much time on
> the simple features such as datatypes, operators and control
> structures but nevertheless gives a comprehensive coverage of
> advanced features; especially the cryptic object orientation.

Most people like books published by O'Reilly & Associates. I liked
Learning Java, 2nd Edition.

> Or, given that it's free, should I persevere with the Deitel
> book?, if so - should I uninstall SDK 1.5 and install Java 2 SDK
> 1.2.2 (which I have)? If so - what IDE can I use for SDK 1.2.2?

I would not go back as far as 1.2.2. Most companies are using 1.3.1 or
higher now.

> Should I give up with java altogether and spend my time on C#
> until I'm used to programming in the object oriented framework?
> C# will surely be easier for me as the IDE, libraries, etc. are
> all there.

If you ask a bunch of Java programmers this question you should expect an
obvious answer. Stick with Java. The big reason for programming in Java
are completely lost if you go to C#. That being, the Java program I write
will run on AIX, HP-UX, Solaris, Windows, Linux, etc. A C# program will
run on Windows.

> PS: I wanted to learn java because (a) I'm told it's the
> language used for Oracle forms (which is what I actually wanted
> to use) and I thought it would be a bit daft trying to use
> Oracle without first knowing java. (b) everyone expects me to be
> able to use java anyway and it does look pretty useful.

I don't know anything about Oracle forms. Maybe you should ask an Oracle
newsgroup if you really need to learn Java.

--
Send e-mail to: darrell dot grainger at utoronto dot ca

.



Relevant Pages

  • Re: Another Newbie Question: C or C++
    ... regardless of the language they use. ... Java, but it's not the best language to start with for understanding ... wish I knew a good starter one, but it's been a while...can try Deitel ... books, but they DO provide pretty decent overall coverage. ...
    (freebsd-questions)
  • Re: Which book to choose?
    ... Java How To Program by Deitel & Deitel. ... the tutorials on Sun's ... website are probably the best source of free, supplemental type info on ...
    (comp.lang.java.help)
  • Re: Interpreter error
    ... I wrote a simple Java application from Deitel book.It is compiled by ... JDK1.5 and .class file is generated but when i invoke interpreter by ... an error message was displayed.The error said: ...
    (comp.lang.java.programmer)
  • Re: New to Java
    ... The Java book I found to be helpful is Java how to program by Deitel & ... > particularly interested in programming for at least a year now, ... > on a language to learn. ...
    (comp.lang.java.programmer)
  • Re: loadjava and Java version
    ... I'm trying to upload a Java class into an 8.1.7 database as a Java ... Stored Procedure. ... I issue the following command: ... Oracle 8.1.7 uses Java version 1.2.1. ...
    (comp.databases.oracle.misc)