Homepage
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
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)

Share
Go down
H2V Fuze
----------Master Knight----------
----------Master Knight----------
Aries Dragon
Posts : 48
Points : 129
Forum Reputation : 20
Join date : 2016-07-14
Age : 31
Location : Winchester, UK
View user profilehttps://www.caltech.edu/

Object Oriented Programming Basics for the BKT Client - MISC Empty Object Oriented Programming Basics for the BKT Client - MISC

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.
H2V Fuze
----------Master Knight----------
----------Master Knight----------
Aries Dragon
Posts : 48
Points : 129
Forum Reputation : 20
Join date : 2016-07-14
Age : 31
Location : Winchester, UK
View user profilehttps://www.caltech.edu/

Object Oriented Programming Basics for the BKT Client - MISC Empty Important Instance Methods for Strings

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'
H2V Fuze
----------Master Knight----------
----------Master Knight----------
Aries Dragon
Posts : 48
Points : 129
Forum Reputation : 20
Join date : 2016-07-14
Age : 31
Location : Winchester, UK
View user profilehttps://www.caltech.edu/

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

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.


Ricardo Harerra
Group Moderator
Group Moderator
Posts : 51
Points : 125
Forum Reputation : 20
Join date : 2016-07-20
Location : Mexico,Ciudad Juárez
View user profile

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

on Fri Sep 02, 2016 2:49 pm
Thisi s for the client im guessing?
Sponsored content

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

Back to top
Permissions in this forum:
You cannot reply to topics in this forum