5 Replies Latest reply: Nov 30, 2004 4:51 AM by 807596 RSS

    new to java

    807596
      Hi

      As per qualification I am a chemical engineer. I am interested in programming especially java. What should be the best way? Should i go for java certfications, starting with sun certified java programmer? what books should i consult since i am a beginner?

      Thank you
        • 1. Re: new to java
          796365
          It's difficult to answer your question with specifics as you don't give your objectives. Take a look at this New to Java Center and see if it helps.

          http://java.sun.com/learning/new2java/index.html
          • 2. Re: new to java
            notivago
            With jverds compliments:

            Code Tags

            When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.

            Resources for Beginners

            Sun's basic Java tutorial

            Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.

            http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.

            jGuru. A general Java resource site. Includes FAQs, forums, courses, more.

            JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.

            Bruce Eckel's Thinking in Java (Available online.)
            Joshua Bloch's Effective Java
            Bert Bates and Kathy Sierra's Head First Java. This one has been getting a lot of very positive comments lately.

            Don't Crosspost

            Please don't crosspost. It cuts down on the effectiveness of responses, leads to people wasting their time answering what others have already answered, makes for difficult discussion, and is generally just annoying and bad form.

            Constructor Rules

            Okay, here are the rules for constructors--"ctors" because I'm lazy. Also, because I'm lazy, "super(...)" and "this(...)" mean any super or this call, regardless of how many args it takes, including those that take no args.

            1) Every class has at least one ctor.

            1.1) If you do not define an explicit constructor for your class, the compiler provides a implicit constructor that takes no args and simply calls super().

            1.2) If you do define one or more explicit constructors, regardless of whether they take args, then the compiler no longer provides the implicit no-arg ctor. In this case, you must explicitly define a
            public MyClass() {...} 
            if you want one.

            1.3) Constructors are not inherited.

            2) The first statement in the body of any ctor is either a call to a superclass ctor
            super(...) 
            or a call to another ctor of this class
            this(...) 
            2.1) If you do not explicitly put a call to super(...) or this(...) as the first statement in a ctor that you define, then the compiler implicitly inserts a call to super's no-arg ctor
            super() 
            as the first call. The implicitly called ctor is always super's no-arg ctor, regardless of whether the currently running ctor takes args.

            2.2) There is always exactly one call to either super(...) or this(...) in each constructor, and it is always the first call. You can't put in more than one, and if you put one in, the compiler's implicitly provided one is removed.

            Exceptions

            Here's a quick overview of exceptions:

            The base class for all exceptions is Throwable. Java provides Exception and Error that extend Throwable. RuntimeException (and many others) extend Exception.

            RuntimeException and its descendants, and Error and its descendants, are called unchecked exceptions. Everything else is a checked exception.

            If your method, or any method it calls, can throw a checked exception, then your method must either catch that exception, or declare that your method throws that exception. This way, when I call your method, I know at compile time what can possibly go wrong and I can decide whether to handle it or just bubble it up to my caller. Catching a given exception also catches all that exception's descendants. Declaring that you throw a given exception means that you might throw that exception or any of its descendants.

            Unchecked exceptions (RuntimeException, Error, and their descendants) are not subject to those restrictions. Any method can throw any unchecked exception at any time without declaring it. This is because unchecked exceptions are either the sign of a coding error (RuntimeException), which is totally preventable and should be fixed rather than handled by the code that encounters it, or a problem in the VM, which in general can not be predicted or handled.

            What Every Computer Scientist Should Know About Floating-Point Arithmetic

            What Every Computer Scientist Should Know About Floating-Point Arithmetic

            When Runtime Exec Won't

            When Runtime Exec Won't

            Laws of Software Development

            Jverd The Arrogant's Law Of No Black Magic (with all the real credit going to William of Ockam): When you're completely sure, beyond any possibility of doubt, that you've exhausted all the simple explanations and are ready to start looking for a complex one, go back and find the simple one that you missed

            Hoare & Knuth's Law of Optimization: Premature optimization is the root of all evil.

            Optimization Steps: 1) Don't optimize. 2) (Experts only) Don't optimize yet.

            Artie Effem's Conjecture of Hypothetical Self-Reliance: While waiting for your personal forum slaves to hand you the answer to your problem, pass the time by pretending that you know how to read and do research, and see if you can find the answer before your slaves deliver it to you. Boy, won't they feel stupid.

            Bizarro World Error Message Theory: Error messages, whether from the compiler or the runtime, are not your enemy. They are the friend you know will always be honest with you, even when it hurts. They're telling you something's going wrong. Don't panic. It can be fixed.



            Copyright Notice

            Unless otherwise noted, all content except graphics Copyright � 2004 Jeff Verdegan. All rights reserved.
            You are hereby granted permission to copy, modify, and publish said content. Any publication other than by posting to Sun's Java Forums (http://forum.java.sun.com) must include this copyright notice.
            Unless otherwise noted, all graphics Copyright � Intercosmos Media Group, Inc.
            • 3. Re: new to java
              796440
              Don't start with the certs. Don't even bother with them until you have a very solid handle on the language and some of the common APIs, and even then only if you really either a) need to because your employer requires it or b) just want to test yourself and find out what areas you're weak in (in which case there are probably better ways).

              Start with one or more of these:

              Sun's basic Java tutorial

              Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.

              http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.

              jGuru. A general Java resource site. Includes FAQs, forums, courses, more.

              JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.

              Bruce Eckel's Thinking in Java (Available online.)
              Joshua Bloch's Effective Java
              Bert Bates and Kathy Sierra's Head First Java.
              • 4. Re: new to java
                800322
                The first step is to take drugs. Many drugs. As a chemical engineer, that shouldn't be a problem to you.

                The second step is programming on drugs. How you perform with this determinbes your future career. If you write beautiful code, you're a genious. If you write something that doesn't even compile, but just because the compiler's against you or those pink spiders all over the keyboard made you type mistakes, you're a good average. If you go cocaine, begin to ignore computers and start chasing any women that can't get away in time while believing that there's nothing you couldn't do - go for management.
                • 5. Re: new to java
                  807596
                  Here's a new introductory tutorial from the IBM Java site,

                  http://www-106.ibm.com/developerworks/edu/j-dw-java-intjava-i.html?S_TACT=104AHW02