Question: Object returns int but cannot use it.

Discussion in 'Plugin Development' started by Deminetix, Apr 29, 2011.

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


    I am new to Java, i work in the web development industry so OOP is slightly different.

    I have a question, i use a statement like:

    if(config.getProperty("users." + player.getName() + ".stage") == 0){
    //do some wicked stuff

    It won't let me compare getProperty with the integer because getProperty is an object. But the object returns a result in the form of a number... why is this and how might i get around it? In PHP i would parse the result as an integer

    I get the feeling i should be creating "stage" as an object belonging to each player?

    Solved: I used config.getInt instead of getProperty

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 14, 2016
Thread Status:
Not open for further replies.

Share This Page