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

Java Best way to learn Java in 3 months?

  1. Sep 19, 2013 #1
    I'm joining my school's FIRST Robotics club, and our supervisor has said that we will be using Java to program our robot this year.

    I have self taught myself Python and enjoyed it, but does any pone have any advice/tips/links for helping learn Java? I know it's a whole different animal compared to the basic Python I know, but I want to be a able to contribute to the team and I think it'll be a great learning experience.
  2. jcsd
  3. Sep 19, 2013 #2
    The best way to learn Java in 3 months is to give me $3,000!

    I'm only kidding, although that is a viable option.

    If you know Python, it really shouldn't be too hard to learn Java. I knew Python and C before learning Java. Loops, if/else statements, variables all work the same way in Java and Python, so being familiar with programming is going to come in handy.

    My reccomendation is to download a Java Compiler along with SDK. The 2 most popular Java Compilers / IDEs are "Eclipse" and "NetBeans". I personally like Eclipse better than NetBeans, but they're both good.

    Learn the syntax for the main java functions, like how to print a line (System.out.println()) etc. Learn how to declare scanners. Then look into the fundamentals of Object Oriented programming. You should learn about classes, polymorphism, and inheritance, those are the big topics in OOP.

    Start off simple. Make your basic programs that take in user input and deliver something in return. Then after that move into more complicated territory like making a blackjack game.


    The Java tutorials in the aforementioned link are a good way to start, or you might consider buying a textbook. In my OOP class, we used Java: How to Program 9th edition by Dietel. The book is mediocre, so I won't tell you that it's a good book, but it is currently being used in Universities to teach Java.

    I hope this helps and good luck!
  4. Sep 19, 2013 #3


    User Avatar
    Gold Member

    It's a lot like riding a bike. You don't really learn it from books, you learn it by doing it. MrTheBard's suggestions are good.
  5. Sep 20, 2013 #4
    Python seems awesome for a new programmer. Could it be used for a FIRST Robotics competition? For example, the task for our robot is to shoot frisbees into goals surrounded by a tape that gives feedback to the robot, and we want to design it to where the robot can adjust and fire at this tape.

    Our adult supervisor said that last year they mainly used C++, Java, and Labview. Is Python a good starting language to prepare to "step up" to those languages? Also I've never even heard of Labview, I'm assuming its more of an engineering-only code.... What's it's purpose?
  6. Sep 23, 2013 #5
    I don't see why Python couldn't be used for a robotics competition.

    Python is definitely a good starting language, although I believe that 'C' is a better starting language, since it is not object oriented. That's just my personal preference though. Most of the concepts that you're going to learn in Python or C are going to directly translate over to C++ or Java, the syntax will change slightly, but it will be relatively easy to grasp.

    If you're intent on learning Python, I suggest http://www.learnpythonthehardway.org

    Here's a short bit on Labview: http://en.wikipedia.org/wiki/LabVIEW#Code_compilation

    It seems to me that it's used to actually program the machines and interface with instruments. I have not used Labview, so that's just my guess.
  7. Sep 25, 2013 #6


    User Avatar
    Gold Member

    Possibly, Python does not perform well enough (yet) to be use in robotics, that is, when doing "real time programming", which in a way is what robotics entails because performance nearly always matters. Also, when programming "close to the metal" as in robotics, you need to know exactly--I mean EXACTLY--what is going on in the computer's memory, even if you are using a language such as Java. This is because you may not have very much memory in the robotics target platform. These (performance, and understanding exactly how memory is being used) are what makes robotics challenging, and why Python might not be the best choice--because Python by design tries to save the programmer from having to think about either performance or memory.

    That is good for beginners--it makes them happy. But the cost of it is lack of control over performance and memory.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook