The JAVA club

ram4mira

Active member
  • Jan 14, 2007
    2,628
    17
    38
    36
    JAVA SCJP exam voucher for sale!!

    august 15 th expire wenne

    10 000 Rs only

    if any 1 want PM me

    thx!
     

    coolshano

    Well-known member
  • Sep 1, 2007
    14,327
    618
    113
    N/A
    wow godak kalekata passe onna mama aith awaa.... guys we need mor help to make this club a success..... i would like all kinds of programmers to join this club and make this club bigger than ever...
     

    Jardh

    Member
    Aug 1, 2010
    6
    0
    0
    public class DooBee{
    public static void main(String[] args){
    int x = 1;
    while (x < 3){
    System.out.print("Doo");
    System.out.print("Bee");
    x = x + 1;
    }
    if (x == 3) { // Why must x be equal to 3??
    System.out.print("Do");
    }
    }
    }
     

    zanakinz

    Member
    Nov 25, 2010
    2
    0
    0
    As in
    stuff like
    system.out.print("Hello? Are you there?");

    Or as in complex stuff with pre-defined structure? as in
    public int msg = 0
    Code:
    If(command.equalIgnoreCase("Hello") && msg == 0)
    {
    sendMessage("Hello? Are you there?");
    msg=+1
    } else {
    sendMessage("Yeah you are here!");
    }
    its alright and its not that hard its actually quite simple :D

    (May be wrong just doing stuff off the top of my head :O)

    Edit: From something i was tweaking/working with before!
    Code:
    public class Cooking {
     
     Client c;
     
     public Cooking(Client c) {
      this.c = c;
     }
     
     private int[][] cookingItems = {{317,315,7954,1,30},{335,333,323,20,70},{331,329,323,30,90},{359,361,363,35,100},{377,379,381,40,120},{371,373,375,50,140},{7944,7946,7948,62,150},{383,385,387,80,210},{389,391,393,91,169}};
     
     public void itemOnObject(int id) {
      for (int j = 0; j < cookingItems.length; j++) {
       if (cookingItems[j][0] == id)
        cookFish(cookingItems[j][0],j);
      }
     }
     public void cookFish(int id, int slot) {
      for (int j = 0; j < 28; j++) {
       if (c.getItems().playerHasItem(id,1)) {
        if (c.playerLevel[c.playerCooking] >= cookingItems[slot][3]) {
          c.startAnimation(883);
         if (Misc.random(c.playerLevel[c.playerCooking] + 3 - cookingItems[slot][3]) == 1) {
          c.sendMessage("You accidently burn the fish.");
          c.getItems().deleteItem(id, c.getItems().getItemSlot(id), 1);
          c.getItems().addItem(cookingItems[slot][2], 1);
         } else {
          c.getItems().deleteItem(id, c.getItems().getItemSlot(id), 1);
          c.getItems().addItem(cookingItems[slot][1], 1);
          c.getPA().addSkillXP(cookingItems[slot][4] * Config.COOKING_EXPERIENCE, c.playerCooking);
         }
        } else {
         c.sendMessage("You need a cooking level of " + cookingItems[slot][3] + " to cook this fish.");
         break;
        }
       } else {
        break;
       }
      }
     }
     
     
    }
     
    Last edited: