Question types

Start with

Question limit

of 45 available terms

Print test

40 Matching questions

  1. leading (+) sign
  2. leading (-) sign
  3. Create an object to store a fraction
  4. The @implementation section in detail
  5. Object
  6. Display the value of myFraction
  7. instance
  8. Set the value of your fraction
  9. Rules for forming names
  10. An instance of a car
  11. Create the object (ask the factory to build a car). This zeros out all of the object's instance variables.
  12. The @implementation section
  13. The @ interface section details
  14. Fraction *myFraction
  15. Allocating a new object (using alloc)
  16. A method that takes an argument
  17. When a method name ends with a colon, it means that it is expecting to see an argument.
  18. Return Values
  19. Applying methods to classes or instances
  20. Three-line sequence (final shorthand)
  21. @synthesize
  22. The program section
  23. instance methods
  24. Factory or class methods
  25. state
  26. The program section in detail
  27. method
  28. The @interface section
  29. The ultimate goal for objects
  30. Each time a new car is manufactured, a new instance from the class of car is created, and each instance of the car is referred to as an object.
  31. The @implementation section general format
  32. A value is returned from a method using the return statement.
  33. Two-line sequence of allocating a new instance of a class and initializing it
  34. Initialize the object
  35. General format for the @interface section
  36. The name of the class
  37. Applying the same methods to different objects is one of the key concepts of object-oriented programming
  38. Specifying an integer argument
  39. How to get a new car
  40. You can also declare the instance variables for a class in the interface section. This is considered a better way to define a class.
  1. a automatically generates methods for you
  2. b A thing.
  3. c [ ClassOrInstance method ];
    [ receiver message ];
  4. d Note
  5. e 1. You have to define where the class came from when you define a new class. That is, you have to name it's parent class.

    2. You need to define the type of operations, or methods, that can be used when working with objects from this class.

    3. You also need to list items known as properties
  6. f - (int) returns an integer
    - (void) returns no value
    - (double) returns a decimal

    Tells the program what type of value the method returns
  7. g - (void) setNumerator: (int) n;
  8. h note
  9. i Make your programs easier to write, code, and maintain.
  10. j Methods that apply only to your car
  11. k Fraction *myFraction;
  12. l - (void) setNumerator: (int) n;

    Integer arguments are indicated by the (int) in front of the argument name.
  13. m @interface NewClassName: ParentClassName
  14. n [ yourCar setSpeed: 55 ];

    set the speed to 55 mph
  15. o // Set fraction to 1/3

    [myFraction setNumerator: 1];
    [myFraction setDenominator: 3];

    The first message statement sends the setNumerator: message to myFraction. The argument that is supplied is the value 1.

    Inside the setNumerator: method, the passed value of 1 is stored inside the variable n. The single program line in that method effectively stores that value in the instance variable numerator.
  16. p yourCar = [ Car new ];

    You send a NEW message to the car class (the receiver of the message) asking it to give you a new car. The resulting object (which represents your unique car) is then stored in the variable yourCar. From now on, yourCar can be used to refer to your instance of the car.
  17. q An action that is performed on an instance of a class or to the class itself
  18. r Describes the data (the instance variables that objects from a class will store) and contains the actual code that implements the methods declared in the interface section.
  19. s indicates an instance method
  20. t @implementation NewClassName

    NewClassName is the same name that was used for the class in the @interface section.

    The memberDeclarations section specifies what types of data are stored in your instance of the class. It is enclosed inside its own curly braces

    int numerator;
    int denominator;

    The members declared in this section are known as instance variables. Each time you create a new object, a new and unique set of instance variables are also created.

    The methodDefinition part of the @implementation section contains the code for each method specified in the @interface section.

    Each method starts by identifying the type of the method (class or instance; + or -), its return type, and its arguments and their types. Instead of the line ending in a semicolon, the code for the method follows, enclosed in a set of curly braces.

    -(void) print
  21. u You have to describe the data that members of the class will contain. These members are called instance variables. You declare the methods in the @interface section and then you define them in the @implementation section.
  22. v The method new is an example of a class method because you have to go to the factory to get a new Car.
  23. w Describes the class and its methods
  24. x myFraction = [[Fraction alloc] init]
  25. y myFaction = [myFraction init];

    Note that you are not sending the init method to a class, you are sending it to the instance of the class
  26. z object oriented programming example
  27. aa NSLog (@"The value of myFraction is: ");
    [myFraction print]

    invokes the print method
  28. ab indicates a class method
  29. ac A unique occurrence of a class
  30. ad They must begin with a letter or underscore (_) and they can be followed by any combination of letters (uppercase or lowercase), underscores, or the digits 0 through 9.
  31. ae Fraction *myFraction = [[Fraction alloc] init]
  32. af Note

    return 0;
  33. ag Your particular car
  34. ah enough space is reserved in memory to store the object's data, which includes space for its instance variables, and a little more. The location where the data is stored is returned by the alloc routine, and assigned to myFraction.
  35. ai The asterisk represents a reference (or pointer) to a object. The variable myFraction doesn't actually store the fraction's data. Instead it stores a reference - which is a memory address - indicating where the object's data is located in memory. You can think of it as an empty box.
  36. aj myFraction = [Fraction alloc];
  37. ak Applying a method to an object will affect the state of that object
  38. al car
  39. am This section contains the code to solve your particular problem, which can be spread out across many files. Somewhere you must have a routine called main. That's where your program begins execution.
  40. an Contains the program code to carry out the intended purpose of the program.