Fresh, hot, java...

Jedi_Master_HayatoJedi_Master_Hayato Join Date: 2002-08-15 Member: 1173Members
<div class="IPBDescription">...not the beverage, silly.</div>Hey all ye l33t coders,

I'm taking a Java course, and doing rather fine in it until we have to start writing our own java class files.  anyone out there with any tips for that?  I think I know what they are trying to teach us, but I don't (the teacher teaches like he's rushed, and the TA's are Grad students, and talk in machine level code).

<!--emo&:(--><img src="http://www.natural-selection.org/iB_html/non-cgi/emoticons/sad.gif" border="0" valign="absmiddle" alt=':('><!--endemo-->
/me wishes I was back in CO still learning Ada....

Comments

  • HikeebaHikeeba Join Date: 2002-10-03 Member: 1418Members
    Plan your classes first.

    And what about it, exactly, is causing the trouble?
  • Jedi_Master_HayatoJedi_Master_Hayato Join Date: 2002-08-15 Member: 1173Members
    I've looked at some examples in our book, and tried to use them as framework for similar programs, but I don't understand them; I mean I can read the code but I don't get even a vague idea of how the two files <i>interact</i> with each other.
    Maybe I'm thnking into it too much; I mean it can't be as easy to read (i.e. <b>transliterate</b> the code) as a simple 'while' loop, or even nested 'if' and 'for' loops.
  • HikeebaHikeeba Join Date: 2002-10-03 Member: 1418Members
    I think you may be thinking about it too much.  It is just about as easy as a while loop.  If you don't have the <a href="http://java.sun.com/docs/books/tutorial/index.html" target="_blank">Sun Java Tutorial</a>, get it.  It does a great job of explaining OOP and classes.  

    I've never tried to explain this before, so bear with me and then kick me if this doesn't help.  The simplest way to explain how the files interact is that they just do.  A class is a data type that you create.  It's your own custom int.  When you create a custom int object, the JRE is going to look for the .class file that contains your custom int and then create the object.  The object is now running around in memory and any interaction is going to be done with the created object.  The .class file won't matter anymore unless you create another custom int object.

    I don't know if my babbling will help at all, but this should:
    <a href="http://java.sun.com/docs/books/tutorial/java/concepts/practical.html" target="_blank">How do these concepts translate into code?</a>

    And here's another good spot:  <a href="http://www.gamedev.net/community/forums/forum.asp?forum_id=24" target="_blank">GameDev.net Forums Java Development</a>
Sign In or Register to comment.