Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Java Programming

  1. Oct 10, 2011 #1
    I want to start learning Java programming,by myself. I got some PDF books. In the introduction, it talks about UML, but I find it complicated. I want to know whether it is a must to read the theory part, or I can just start on the practical part.
     
  2. jcsd
  3. Oct 10, 2011 #2

    Mark44

    Staff: Mentor

    IMO, the UML (Unified Markup Language?) part is not germane to learning about Java.
     
  4. Oct 11, 2011 #3
    So what shall I read about? Do you mean that I can go directly to the practical part?
     
  5. Oct 11, 2011 #4
    And, I was been told by my teacher that I should study C++ first, is it true?
     
  6. Oct 11, 2011 #5
    Better begin with C. I too began learning Java but lost all my enthusiasm while going through 'OOPS'. It made me say oops, then my teacher told me to begin learning C and now I can feel the difference. Best of luck.
     
  7. Oct 11, 2011 #6

    jtbell

    User Avatar

    Staff: Mentor

    If the Java stuff doesn't use the UML stuff enough that it gets in the way, you should be able to skip ahead to the Java stuff. If the UML stuff does get in the way, find another book.

    Did he say why? I don't think it's necessary, but I've never studied Java myself, just C++ (and a few other languages), so I can't compare how the two are for learning, from personal experience. Lots of schools and universities teach Java as their first programming language.
     
  8. Oct 11, 2011 #7

    phinds

    User Avatar
    Gold Member
    2016 Award

    My own point of view on this, and it is NOT one that is universally shared, is that you are MUCH better off leaning a sequential programming language such as C before you try to learn OOP languages such as C++ and JAVA. As physics kiddy pointed out, the OO stuff can make your head hurt and make you want to NOT learn programming, whereas sequential programming, which can be difficult enough all by itself, is FUN.

    Once you learn sequential programming, THEN the advantages of OOP become obvious and you are much more willing to put up with the occasional headache it will give you.
     
  9. Oct 11, 2011 #8

    jtbell

    User Avatar

    Staff: Mentor

    Or the "sequential" (procedural) parts of C++. :wink: You can do a lot with C++ before learning how to create your own classes (objects), just using classes that others have written such as the ones in the standard library. IMO the C++ 'string' type is much easier to use than C-style char arrays and pointers for text data, and simple I/O is easier with the C++ 'cin' and 'cout' objects than with C-style input and output functions.
     
  10. Oct 11, 2011 #9

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    You can write procedural programs in Java if you really want to. Just declare everything "public static" and away you go.

    ... which is part of the reason why Java doesn't have pointers at all. (Pause for C programmers to recover from falling off their chairs in shock...)

    Java can do all the "good" things you can use C pointers for, but there is no way to mess around with the contents of memory directly. This tends to made debugging Java programs rather boring, compared with some other languages :devil:

    Personally I'm in favor of starting to learn OOP as soon as possible (i.e. within hours of starting to learn to program rather than months or years). Otherwise, there is the danger of knowing enough to "get by" with procedural programming and losing the incentive to learn OOP "properly".
     
  11. Oct 11, 2011 #10

    Mark44

    Staff: Mentor

    I'm with JTBell in thinking that a programmer should start with a procedural language before learning OOP. At some point, even OOP programmers need to understand how to write code that executes sequentially, and how conditional branches and loop structures work.
     
  12. Oct 11, 2011 #11

    jtbell

    User Avatar

    Staff: Mentor

    The last couple of years that I taught our two-semester intro programming sequence in C++, before we switched it to Java and someone else took it over, I was using strings and the standard library containers (vectors etc.) so much that I wasn't using pointers at all until right at the end of the course. I had to invent some really hokey examples to try to motivate using pointers. The other CS guys in the department told me not to worry too much about it, because students would be forced to come to grips with pointers when they got to assembly language in a later course anyway.

    My feeling is that designing and writing classes should be delayed long enough so that students become comfortable with using classes that others have written, and having to go by the documentation for the classes without knowing in detail what's going on inside them. I think it makes the concept of "information hiding" clearer and more concrete when they start writing their own classes, and gives them a better idea of what their "responsibilities" are.

    Likewise for ordinary functions, for that matter. I always gave them practice in using standard functions (usually from the math library) before teaching them how to write their own.
     
  13. Oct 11, 2011 #12

    diazona

    User Avatar
    Homework Helper

    No, UML has nothing to do with Java. I've been writing Java programs for more than 10 years and I still don't know the first thing about UML :wink:

    Well, maybe the first thing... UML stands for Unified Modeling Language, and it's basically a standard way of diagramming how the parts of a complex computer program interact with each other. I would advise you not to learn it before you've gotten very comfortable with plain old programming.
    Seems like an odd sequence, since C++ is considerably more complicated than Java. Then again, programming is a complex discipline so perhaps there's something to be said for choosing a language that doesn't let you take too many shortcuts as you're learning it.

    I'm actually a fan of Python as a first programming language, for what it's worth.
     
  14. Oct 11, 2011 #13
    Oh,, then I think I should start learning C++ first.Thanks
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Java Programming
  1. Java programs (Replies: 9)

Loading...