Show Menu
Cheatography

OO Cheat Sheet by [deleted]

Gleitk­omm­a-A­rit­hmetik

1/0.0
POSITI­VE_­INF­INITY
-1/0.0
NEGATI­VE_­INF­INITY
0/0.0
NaN
1/0
java.l­ang.Ar­ith­met­icE­xce­ption: / by zero

Overlo­ading & Overriding

Overlo­ading: Zur Compil­etime

=> Immer die Spezif­ischte

Overriding: Zur Runntime

class Graphic {

void moveTo­(Gr­aphic other) {

// Method 1

}

}


class Circle extends Graphic {

void moveTo­(Gr­aphic other) {

// Method 2

}

void moveTo­(Circle other) {

// Method 3

}

}


g.move­To(c)

Overlo­ading zur Compil­etime:
- Nur Method 1 & 2 Möglich, Brille "­Gra­phi­c"

Zur Runntime:
- Ah, g ist ein Circle, dann wird Method 2 aufgerufen

Java reference types

int[] x = new int[10];
Normales Array
int[][] m = new int[2]­­[3];
2 Dimens­ionales Array
Array­­s.e­­qu­a­ls(a, b)
Arrays vergle­ichen
Array­­s.d­­ee­p­E­qu­­als(a, b)
n-Dime­nsi­onale Arrays vergle­ichen
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.