GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Karteikarten

OOP - Instance and Static Variables

nhunsdale02 Programming I Masters Englisch 10 Karten

Karten in diesem Stapel (10)

  1. 1Local Variables What are they? What is there scope?Variables declared in the body of a method
    No scope beyond the method they were declared in
  2. 2Attempting to refer to variables beyond their scope will cause a _____ _____ errorcompile time
  3. 3Instance Variables What are they?Variables that are declared in the class NOT within a method
  4. 4What are getters and setters?2 methods that manipulate the attributes that belong to a particular object (or class)
  5. 5What is the general format of a "get()" method using an int as an example?public int getInt(){
    return classInt;
    }
  6. 6What is the general format of a "set()" method using an int as an example?public void setInt(int age){
    this.age = age;
    }
  7. 7Static Variables Every object has its own copy of all the instance variables of the class. "static" makes the variable _____constant
  8. 8Static Variables What is their scope?Class Wide
  9. 9Static Variables How can you access them from other classes? Given that the name of the class it resides in is called "Nathan" and the variable is called "age"Nathan.age;
  10. 10To use a static method in another class, does an object have to be instantiated? Can a "this" keyword be used in a static method?No
    No

Informationen

Beschreibung
Masters Programming I Karteikarten am OOP - Instance and Static Variables, erstellt von nhunsdale02 am 05/06/2014.
Erstellt von
nhunsdale02
Aufrufe
16
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck