GoConqr has a new look! Let us know what you think.

Flashcards

OOP - Instance and Static Variables

nhunsdale02 Programming I Masters English 10 cards

Cards in this deck (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

Information

Description
Masters Programming I Flashcards on OOP - Instance and Static Variables, created by nhunsdale02 on 05/06/2014.
Created by
nhunsdale02
Views
16
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?