Programmieren_2 JAVA
Klausur September
Klausur September
Set of flashcards Details
Flashcards | 22 |
---|---|
Language | Deutsch |
Category | Computer Science |
Level | University |
Created / Updated | 28.08.2013 / 30.01.2018 |
Weblink |
https://card2brain.ch/box/programmieren2_java1
|
Embed |
<iframe src="https://card2brain.ch/box/programmieren2_java1/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>
|
Create or copy sets of flashcards
With an upgrade you can create or copy an unlimited number of sets and use many more additional features.
Log in to see all the cards.
Instanzmethode "setLocation", die die Koordinaten des Punktes auf die übergebenen Werte "newx" und "newy" ändert.
public void setLocation(int newx, int newy){
x=newx;
y=newx;
}
Instanzmethode "translate", die die Koordinaten des Punktes um die gegebene Deltas "dx" und "dy" verschiebt.
public void translate(int dx, int dy){
x=x+dx;
y=y+dy;
}
alternativ:
public void translate(int dx, int dy){
setLocation(x+dx,y+dy);
}
Instanzmethode "distance", die den Abstand zw. einem Punkt und einem anderen "Point" Parameter ermittelt.
Formel: SQRT((X2 - X1)^2+(Y2-Y1)^2)
public double distanceFromOrigin(){
return Math.sqrt(x*x+y*y);
}
alternative:
public double distanceFromOrigin(){
Point origin = new Point();
return distance(origin);
}
Konstruktor ohne Parameter für die Klasse Point, der den Punkt auf (0,0) initialisiert.
public Point(){
x=0;
y=0;
}
Was heißt Invariante?
Die Invariante garantiert man, indem man in Änderungsmethoden eine entsprechende Prüfung der Parameter vornimmt.
Was ist eine Klasse?
Was ist ein Objekt?
Was heißt Abstraktion?
Was ist eine Instanz?
Was ist ein Attribut?
Was ist ein Feld oder Datenelement?
Was ist ein Accessor?
Was ist ein Mutator?
Was ist ein Konstrukor?
Was ist ein Standardkonstruktor?
Was ist ein Privates Attribut?
Rechte von "public"
zugreifbar für Code....
Rechte für "protected"
zugreifbar für Code...
Rechte für "(Keiner)"
zugreifbar für Code...
Rechte für "private"
zugreifbar für Code....
Was heißt "static"?
Was heißt "Statisches Attribut"?
-
- 1 / 22
-