Thread: Void to boolean

Results 1 to 3 of 3
  1. #1 Void to boolean 
    Banned

    Join Date
    Sep 2010
    Age
    29
    Posts
    567
    Thanks given
    147
    Thanks received
    202
    Rep Power
    0
    Code:
    src\com\rs2\exotica\model\content\skills\Fletching.java:69: incompatible types
    found   : void
    required: boolean
                            if(player.getInventory().addItem(new Item(itemToReceive,
     amount)));
                                                            ^
    Code:
    if(player.getInventory().addItem(new Item(itemToReceive, amount))) {
    How do I make it a boolean? and what did I do wrong
    Reply With Quote  
     

  2. #2  
    Registered Member
    Whired's Avatar
    Join Date
    Aug 2007
    Posts
    2,126
    Thanks given
    238
    Thanks received
    500
    Rep Power
    822
    Is
    Code:
    player.getInventory().addItem()
    defined as a boolean method?

    If it's defined as a void method , using it as a boolean still won't work
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Sep 2010
    Age
    29
    Posts
    567
    Thanks given
    147
    Thanks received
    202
    Rep Power
    0
    Quote Originally Posted by Whired View Post
    Is
    Code:
    player.getInventory().addItem()
    defined as a boolean method?

    If it's defined as a void method , using it as a boolean still won't work
    oops got it thanks
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Use the boolean instead of int!!!!
    By Nemmyz in forum Tutorials
    Replies: 50
    Last Post: 09-30-2010, 12:09 AM
  2. what is a boolean?
    By sylas in forum Application Development
    Replies: 2
    Last Post: 05-09-2010, 04:45 AM
  3. boolean ??
    By devildreams54 in forum Help
    Replies: 4
    Last Post: 08-08-2009, 10:41 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •