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 «

Calendar reminder to all members: World FreQuency Championship 2016 (December 1st)
*CLOSED*Today (15th - 17th October) is the Final Day To Register Your Team for The Halo 5 FreQuency 4v4 Championships *CLOSED*
"Frequency Community Closed/Underground Till Further Notice" - stated by: FreQ Avail and FreQ Invictus
Gamenight Activity #901 - Hosted by FreQ|AvaiL (Activity Ended: 5th of August <11:59PM> AEST)

Object Oriented Programming Basics for the BKT Client - MISC

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

Posts : 44
Points : 120
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 : 44
Points : 120
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 : 44
Points : 120
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 : 42
Points : 111
Reputation = Likes - Dislikes: : 15
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 Fri Nov 24, 2017 7:40 am