FreQuency Halo Community

In order to access certain forum threads, this forum requires you to login with your user name and password so we can verify your current access level.
Thanks,
Forum Security Adminstrator - Don.E
FreQuency Halo Community

» §niping Døjo «

Congratulations: World FreQuency Champion 2016 (December 1st) - Team Lycan and Invictus
*CLOSED*2018 (24th - 26th July) is the Final Day To Register Your Team for "The Halo 5 3v3 and FFA Tournament" *CLOSED*
FreQuency Community BACK ONLINE!!!- stated by: FreQ Xaye and FreQ AvaiL
Gamenight Activity #997 - Hosted by FreQ|AvaiL and FreQ June Mia (Activity Ended:18th of July <11:59PM> AEST)

Object Oriented Programming Basics for the BKT Client - MISC

Share
avatar
H2V Fuze
----------Master Knight----------
----------Master Knight----------

Posts : 46
Points : 122
Reputation = Likes - Dislikes: : 17
Join date : 2016-07-14
Location : Winchester, UK

Object Oriented Programming Basics for the BKT Client - MISC

Post by H2V Fuze on Thu Sep 01, 2016 3:25 am

Rectangle               \This is your (Class)
---------------
length: real              \\THESE ARE (Data Members)
breadth: real
----------------
are(): real
perimeter(): real       \\\These are (Methods)
diagnol(): real
isSquare(): boolean
shorterSide(): real
longerSide(): real
equals(rectangle): boolean
--------------------------------

Normally a CLASS of an object is written with the first character as a capital. Such as Rectangle not "rectangle"

Reason why you write Rectangle with a capital is to defirentiate it to be a CLASS.
avatar
H2V Fuze
----------Master Knight----------
----------Master Knight----------

Posts : 46
Points : 122
Reputation = Likes - Dislikes: : 17
Join date : 2016-07-14
Location : Winchester, UK

Important Instance Methods for Strings

Post by H2V Fuze on Thu Sep 01, 2016 3:35 am

Important Methods for String data types:

.charAt(int) : char
.indexOf(char): int
.indexOf(String): int
.substring(begin): String
.toLowerCase(): String     --> ("HelLO BKT" --> becomes "hello bkt");

String s = "Finally";
String t = s.substring(0, 5) + "_bkt";     //This method returns  "Final"+"_bkt"
This then gets concatanated and becomes "Final bkt"


String greeting = new String ("hello bkt client")
String ("hello bkt client") --> this is a REFERENCE
greeting --> this is the OBJECT

Also key note a String can be thought of a CHARACTER ARRAY, like so (in a string of "Hello") the character array would be:
[0] = 'h'
[1] = 'e'
[2] = 'l'
[3] = 'l'
[4] = 'o'
avatar
H2V Fuze
----------Master Knight----------
----------Master Knight----------

Posts : 46
Points : 122
Reputation = Likes - Dislikes: : 17
Join date : 2016-07-14
Location : Winchester, UK

Re: Object Oriented Programming Basics for the BKT Client - MISC

Post by H2V Fuze on Thu Sep 01, 2016 3:47 am

Code:
public class Rectangle {
  public double width, height;        //My clients data members
 
  public double area(){              //My clients methods
      return width * height;
  }

}


If you want to import certain methods such as pi, type Math.pi
or Math.Cosine to find the Cosine of a triangle.


avatar
Ricardo Harerra
Group Moderator
Group Moderator

Posts : 47
Points : 117
Reputation = Likes - Dislikes: : 16
Join date : 2016-07-20
Location : Mexico,Ciudad Juárez

Re: Object Oriented Programming Basics for the BKT Client - MISC

Post by Ricardo Harerra on Fri Sep 02, 2016 2:49 pm

Thisi s for the client im guessing?

Sponsored content

Re: Object Oriented Programming Basics for the BKT Client - MISC

Post by Sponsored content


    Current date/time is Mon Dec 17, 2018 11:07 pm