Solved Check two integers

Discussion in 'Plugin Development' started by ThrustLP, Mar 2, 2014.

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

    ThrustLP

    Hi!

    I've got two integers:

    int votes1 = 5;
    int votes2 = 5;


    How can I check if they both are 5?
    If they both are fife do...
    else...



    Thank you!
     
  2. Offline

    SuperOmegaCow

    ThrustLP
    Basic java...:
    Code:java
    1. if(votes1 == 5 && votes2 == 5) {
    2.  
    3. // do stuff
    4. } else {
    5.  
    6. //do stuff
    7. }
     
  3. Offline

    hexaan

    Code:java
    1. if(votes1 == 5 && votes2 == 5){
    2. //do stuff
    3. }


    May I suggest you follow some tutorials on basic Java programming. They would help you figuring out some fundamentals of programming.
     
  4. Offline

    Hexcept

    Code:java
    1. if(votes1 == 5 && votes2 ==5) {
    2. // both equal 5
    3. }
     
  5. Offline

    ThrustLP

    I do :)

    I've only typed one = instead of two
     
  6. Offline

    jthort

    ThrustLP I know this was solved but just for future reference you only use "==" if your checking a boolean, use "=" if your setting a variable to something.

    Just felt like I should say that :)
     
  7. Offline

    ThrustLP

    Thank you all!
     
Thread Status:
Not open for further replies.

Share This Page