Preview

Computer Science Study Notes

Good Essays
Open Document
Open Document
1782 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Computer Science Study Notes
Computer Science Exam

Classes, Objects, and Methods
Attributes – data components of a class that provide and traits for the object of that class; also called fields, properties, and instance variables
Methods – code associated with an object in order to make it function and behave according to the class to which it belongs:
Constructor methods – to create or instantiate objects from the class definition
A default constructor will always be created and will initialize fields to 0, false, or null
Create your own constructor method with the same name as the default when the default values are not wanted, this is called overloading
Mutator/Accessor methods – to set and retrieve the instance variables/fields associated with each object that is created from the class

Mutators are used to directly access an object’s field to set it’s value
Mutator methods begin with the prefix “set” followed by the name of the corresponding instance variable
Mutators do not have a return value, void
Accessors are used to directly access an object’s field to get or retrieve it’s value
Accessor methods begin with the prefix “get” followed by the name of the corresponding instance variable
Accessors return this.variable

Behavior methods – to create the actions and functionality of the object
Class Header – made of three parts: access modifier, keyword class, name of class
Data Fields – or Instance variables, declared with private in order to protect data and hide information
This – refers to the current object being built, also helps to further distinguish between local variables from the parameter list and the object’s field variables
Encapsulation – the inclusion within an object of all the resources needed for the object to function, thought to be self-contained
Object Interface – how the client code can interact with an object through its public methods
Functional Decomposition – creating clearly defined behavioral/functional methods for a

You May Also Find These Documents Helpful

  • Satisfactory Essays

    4. What is a local variable? What statements are able to access a local variable?…

    • 765 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    The data access object (DAO) software program design pattern encapsulates use of data by concealing its difficulty from end users (University of Phoenix, 2005). This design pattern is a concept offering an abstract interface to a database or perseverance method, which it only provides a few specified functions excluding the visibility of the database particulars. The DAO includes a mapping from the software calls to its perseverance layer that isolates the general public interface of the DAO.…

    • 579 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Mat 540 Week 4 Paper

    • 1775 Words
    • 8 Pages

    If you consider a kitchen, you see it is also composed of several, smaller components, including the oven, refrigerator, and microwave. Top-level objects are composed of smaller components that do the actual work. This perspective is a very natural way of looking at our world, and one with which we are all familiar. We do the same thing in object-oriented programming:…

    • 1775 Words
    • 8 Pages
    Powerful Essays
  • Good Essays

    A5: Constructors are used to initialize objects in java, at the time of object creation it is invoked. It provides data for an object that is why it is called a constructor. Constructor is automatically called immediately after the object is created, before the new operator completes. Constructors look a little strange because it has no return type, not even valid.…

    • 559 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Psy300 Week 8

    • 760 Words
    • 4 Pages

    Understanding object-oriented methodologies is often difficult. You already understand that object-oriented analysis and design emulates the way human beings tend to think and conceptualize problems in the everyday world. With a little practice, object-oriented programming will become second nature to you.…

    • 760 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    6 8c Chapter Excercises

    • 515 Words
    • 2 Pages

    Polymorphism is the concept that a message gives different meanings to different objects. For example GOOD NIGHT message might produce different results depending if it is received by a child or the family dog. When received by the parent object the message causes the parent object to read a bedtime story. When received by the dog object it causes the dog to go to sleep and when received by the child object it causes the child to get ready for bed.…

    • 515 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    a.x is available to code that is written outside the Sphere class. b.radius is not available to code written outside the Sphere class. c.radius, x, y, and z are called members of the Sphere class. d.z is available to code that is written outside the Sphere class.…

    • 1368 Words
    • 9 Pages
    Satisfactory Essays
  • Better Essays

    Plsql Chap7 Sols

    • 2330 Words
    • 17 Pages

    12. If there are values referenced continually in the application, storing them in packaged variables will allow the values to only be retrieved once thus saving data retrieval processing. The values in global constructs are persistent for the entire user session.…

    • 2330 Words
    • 17 Pages
    Better Essays
  • Satisfactory Essays

    functions and functionalities that are equipped in the item. the hard-to-find item information guidebook can also lie…

    • 1498 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    Diploma H&Sc

    • 755 Words
    • 4 Pages

    Objects: can be used for point of reference, example holding up a cup when ask somebody if they would like a drink. The object can help the person to understand what you are saying.…

    • 755 Words
    • 4 Pages
    Good Essays
  • Better Essays

    Element: Objects that possess the information the researcher seeks and about which the researcher will make inferences.…

    • 2105 Words
    • 9 Pages
    Better Essays
  • Good Essays

    When interface screens are well laid out and clearly defined, object derivation is generally straight forward.…

    • 440 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Java Test

    • 469 Words
    • 2 Pages

    Q3. “ X extends Y “ is correct if and only if X is a class and Y is an interface.…

    • 469 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    NLP in language teaching

    • 676 Words
    • 3 Pages

    Richards and Rodgers wrote about method as an as an umbrella term comprising approach, design, and procedure.…

    • 676 Words
    • 3 Pages
    Good Essays
  • Good Essays

    C Program

    • 808 Words
    • 4 Pages

    A variable is said to belong to the automatic storage class if the validity or scope of the variable is limited to only the function in which it has been defined. Automatic variables are declared inside the function in which they are to be utilized. They are created when the function is called and destroyed automatically when the function is called and destroyed automatically when the function is exited, hence the name automatic. Automatic variables are therefore local to the function in which they are declared. Because of this property, automatic variables are also referred to as local or internal variable.…

    • 808 Words
    • 4 Pages
    Good Essays