What this means?

Discussion in 'Plugin Development' started by GaaTavares, Sep 1, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    GaaTavares

    Code:java
    1. for (int i = 0; i <= name; i++) {
    2.  

    I know is a loop of an integer, but not exatcly what means? Can anyone help me?
    -- NEWB QUESTION HERE ---
     
  2. GaaTavares Well, int i = 0; so when it's smaller then variable 'name' then i +1 untill it has the same ammount as name.
     
  3. Offline

    ChrisixStudios

    That means that block of code is going to loop until i > name and at the end of the block do the code i++ (which is the same as i = i + 1) I hope that answers your question
     
  4. Offline

    Cirno

    You guys are forgetting that it says <=, not < :p
    So, while i is less then or equal too name, do xyz, and then add 1 to i.

    Let's say name = 5.
    It would loop like this:
    0
    1
    2
    3
    4
    5
    You technically loop around 6 times, rather then 5.
     
  5. Offline

    CubieX

    If you can't tell what this is doing, you really should read a Java book or study online tutorials.
    This is the most basic stuff and nothing that should be asked in a developer forum.
    A "developer" should at least know some basic Java.

    Learn the "what" and then come back here to ask for the "how" if necessary. ;)
     
  6. Offline

    GaaTavares


    I know its a java part, i know the rest, dont think i'm so newb as look. I'm just confused with this, its just with this that i have doubts. You reply looks like offensive.
     
  7. Offline

    CubieX

    It was not meant to be offensive.
    I encourage everyone who really wants it, to learn how to code plugins.
    Many minecraft players just want to start coding plugins, without having learned a programming language ever before, because there are so many ideas and possibilities they want to realize.
    But almost everyone who develops plugins seriously has some background of studying the language,
    before trying to do productive things with it.
    They learned it in school or uninversity or have taken other programming courses to some degree.
    You have to know your tools before trying to use them. It's not different from other areas of your life.
    Without a solid base knowledge, you won't come far with this.
    This is why I strongly suggest that you read books or study by using online tutorials
    to get down the concepts of object oriented programming in general and the Java language in particular.
    At least to a point where you are no longer confused about common Java syntax.

    And my main point was, that this forum is for developers. Not for Java beginners.
    This is not offensive. It's just the truth.
    Some people may help you anyway. And It's ok. But it's not the point of this forum.

    I don't know If it's alowed to link to other forums.
    But if you search for "java forums" you will find sites which are better suited for Java beginners
    and have answers to almost every question you may have.
    Please have a look. ;)
     
    Quantix likes this.
  8. Offline

    GaaTavares

    This is a developer forum, but why never asking one question? You said your reply isn't offensive, but you said like: Shut up you dont know nothing, get out of here. I solved my problem, i know the for method, i was just with doubts with the int++. I'm learning java, dont worry about that.
     
Thread Status:
Not open for further replies.

Share This Page