OO Cheat Sheet

A cheat sheet in English by [deleted]
2,311 views 850 downloads 12 Jan 2016 History
3.7 avg · 0 ratings

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

Badges

Nice Cheat Sheet

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.