Thread: Basic Java KeyWords

Results 1 to 9 of 9
  1. #1 Basic Java KeyWords 
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Purpose: To Teach About the Basic Java Keywords
    The Following Tutorial Is About The most common used in Private servers

    boolean
    break
    case
    else
    false
    if
    int
    private
    public
    return
    static
    String
    switch
    true

    BOOLEAN
    A boolean is a value that is either true or false. A boolean can either be public or private
    Code:
    ProtMage == false &&
    ProtRange == false &&
    ProtMelee == false
    The Above code are all examples of Booleans because they can either be true or false. in this can false

    BREAK;
    The break keyword is used to close a for, while, or do loop or to mark the end of a case block in a switch statement.

    Code:
     case 0: // Attack levelup
    sendFrame164(6247);
    stillgfx(199, absX, absY);
    sendFrame126("Congratulations, you just advanced an attack level!", 6248);
    sendFrame126("Your attack level is now "+playerLevel[0]+" .", 6249);
    sendMessage("Congratulations, you just advanced an attack level.");
    stillgfx(199, absY, absX);
    NpcDialogueSend = true;
    break;
    In the Above Example the break; is used to close a case in a switch statement

    CASE
    The case is used to label each branch in a switch statement

    Code:
    switch(skill)  
    {
           case 0: // Attack levelup
    sendFrame164(6247);
    stillgfx(199, absX, absY);
    sendFrame126("Congratulations, you just advanced an attack level!", 6248);
    sendFrame126("Your attack level is now "+playerLevel[0]+" .", 6249);
    sendMessage("Congratulations, you just advanced an attack level.");
    stillgfx(199, absY, absX);
    NpcDialogueSend = true;
    In the above example case 0: is a branch of switch(skill)

    ELSE
    The else keyword is always used in association with the if keyword in an if−else statement

    Code:
    if(command.equalsIgnoreCase("Test1")) {
    teletox:0000
    teleto7:0000
    }
    else if(teleblock == true)
    {
    sendMessage("A magical force stops you from teleporting.");
    }
    Th above example is stating that if they have had tele-block casted on them they will be unable to teleport.

    if
    The if keyword indicates the start of a block of coding

    There are thousands of Examples in you client.java
    The if keyword is used for everything

    int
    An int is a primitive. It is not an Object. And int must be declared before use
    An Int can be either puiblic or private
    Code:
    public int potTimer0 = 0;
    public int potTimer1 = 0;
    public int potTimer2 = 0;
    public int potTimer3 = 0;
    public int potTimer4 = 0;
    public int potTimer5 = 0;
    public int potTimer6 = 0;
    Very few people that use private server's accually know what ints are.

    STATIC
    The static keyword may be applied to a class defined within another class

    Code:
    public static int more2handed[] = {7158};
    
    public static int more2handed()
    {
    return more2handed[more2handed.length];
    }
    SWITCH
    The switch statement is used to select execution of one of multiple code blocks based on an expression.
    Code:
    switch(NPCID) {
    The switch(NPCID) is a switch for the summoning skill. The switch must be closed off by the break; keyword


    PLEASE POST FEEDBACK
     

  2. #2  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Anyone at all
     

  3. #3  
    Whitey
    Guest
    Good Work. This would definitley help newbies. What about void, long, double, array. Etc.
     

  4. #4  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Quote Originally Posted by Whitey View Post
    Good Work. This would definitley help newbies. What about void, long, double, array. Etc.
    I forgot about void

    But i'm putting the basics of keywords used in private servers. long, double, array aren't used that much
     

  5. #5  
    Whitey
    Guest
    Array is, But I suppose long and double arent used much
     

  6. #6  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Ok i'll add Void now and Array
     

  7. #7  
    Registered Member

    Join Date
    May 2007
    Posts
    696
    Thanks given
    0
    Thanks received
    0
    Rep Power
    154
    Good work, this should help the newbs
    Anybody remember me?
     

  8. #8  
    Registered Member
    Alex's Avatar
    Join Date
    Apr 2007
    Posts
    1,658
    Thanks given
    0
    Thanks received
    0
    Rep Power
    284
    nice gj keep it up
    Your password is 354 days old, and has therefore expired.


    Fail
     

  9. #9  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    Thanks for the post's everyone
     


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. Java Keywords
    By iitzTyson in forum Application Development
    Replies: 7
    Last Post: 12-01-2010, 08:36 PM
  2. Java: Very basic 2D-Java-Platform-Game.
    By Brown in forum Application Development
    Replies: 7
    Last Post: 07-18-2009, 09:41 PM
  3. basic java help
    By Warlock 999 in forum Help
    Replies: 3
    Last Post: 04-17-2009, 10:33 PM
  4. Very Basic Java help
    By Edge in forum Application Development
    Replies: 5
    Last Post: 02-06-2009, 04:29 AM
  5. How to learn basic java
    By Rhys in forum Tutorials
    Replies: 5
    Last Post: 08-23-2008, 06:54 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •