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

Flashcards

exam 1

daud hussein English 22 cards

exam 1

Cards in this deck (22)

  1. 1Inheritanceis a mechanism in which one object acquires all the properties and behaviors of parent object
    The idea behind inheritance in java is that you can create new classes that are built upon existing classes. When you inherit from an existing class, you can reuse methods and fields of parent class, and you can add new methods and fields also.
    Inheritance represents the IS-A relationship, also known as parent-child relationship.
    Inheritance
  2. 2Aggregation"has a"
    If a class have an entity reference, it is known as Aggregation. Aggregation represents HAS-A relationship.
    Consider a situation, Employee object contains many informations such as id, name, emailId etc. It contains one more object named address, which contains its own informations such as city, state, country, zipcode etc. as given below.
  3. 3Encapsulationis a process of wrapping code and data together into a single unit, for example capsule i.e. mixed of several medicines.
    encapsulation in java
    We can create a fully encapsulated class in java by making all the data members of the class private. Now we can use setter and getter methods to set and get the data in it
    Advantage of Encapsulation in java
    By providing only setter or getter method, you can make the class read-only or write-only.
    It provides you the control over the data. Suppose you want to set the value of id i.e. greater than 100 only, you can write the logic inside the setter method.
  4. 4polymorphismis the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.
    When one task is performed by different ways i.e. known as polymorphism. For example: to convince the customer differently, to draw something e.g. shape or rectangle etc.
    In java, we use method overloading and method overriding to achieve polymorphism.
    Another example can be to speak something e.g. cat speaks meaw, dog barks woof etc.
  5. 5Data abstractionfocus on operations on the data not the implementation
  6. 6classcollection of data and methods(operations) that operated on that data
    describes a single real world thing
  7. 7data structurestores a collection of homogeneous(alike) data
  8. 8why use OOP???1)OOPs makes development and maintenance easier where as in Procedure-oriented programming language it is not easy to manage if code grows as project size grows.
    2)OOPs provides data hiding whereas in Procedure-oriented programming language a global data can be accessed from anywhere.
    3)OOPs provides ability to simulate real-world event much more effectively. We can provide the solution of real word problem if we are using the Object-Oriented Programming language.
    1.Modularity
    2.Modifiability
    3.ease of use
    4.fail safe of use
    5.style
    6.debugging
  9. 9visibility and scope of variablehe scope of a variable defines the section of the code in which the variable is visible. As a general rule, variables that are defined within a block are not accessible outside that block. The lifetime of a variable refers to how long the variable exists before it is destroyed. Destroying variables refers to deallocating the memory that was allotted to the variables when declaring it. We have written a few classes till now. You might have observed that not all variables are the same. The ones declared in the body of a method were different from those that were declared in the class itself. There are there types of variables: instance variables, formal parameters or local variables and local variables.
  10. 10stages of Software engineeringrequiment
    1.design
    2.implement gathering
    3.testing
    4. maintenance
  11. 11recursionhe base case returns a value without making any subsequent recursive calls. It does this for one or more special input values for which the function can be evaluated without recursion. For factorial(), the base case is n = 1. The reduction step is the central part of a recursive function.
    is when a method calls upon itself to get the most basic case of what its given . Needs a base case to be consider a recurion
  12. 12AbstractionHiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing.
    In java, we use abstract class and interface to achieve abstraction.
  13. 13ADTsa model of a data structure
    that specifies:
    • the characteristics of the collection of data
    • the operations that can be performed on the collection
    • It’s abstract because it doesn’t specify how the ADT will be
    implemented.
    • A given ADT can have multiple implementations.
  14. 14Motivationwhy do we do this
  15. 15walls and mirrorwalls are like recursions
    mirror is data abstraction
  16. 16interfacesAn interface in java is a blueprint of a class. It has static constants and abstract methods only.
    The interface in java is a mechanism to achieve fully abstraction. There can be only abstract methods in the java interface not method body. It is used to achieve fully abstraction and multiple inheritance in Java.
    Java Interface also represents IS-A relationship.
    It cannot be instantiated just like abstract class.
  17. 17relationshipwith data structures can define a data structure it list s what needs to be placed in the class that implemeting the ADT/interface
  18. 18Static and DynamicStatic binding happens at compile-time while dynamic binding happens at runtime.
    Binding of private, static and final methods always happen at compile time since these methods cannot be overridden. Binding of overridden methods happen at runtime.
    Java uses static binding for overloaded methods and dynamic binding for overridden methods.
  19. 19Java collections Framework. Generics allow us to provide the type of Object that a collection can contain, so if you try to add any element of other type it throws compile time error.
  20. 20big Otheoretical measure of efficiency
  21. 21benchmarkingmeasure actual time
  22. 22linked listA linked list is a linear data structure where each element is a separate object.

Information

Description
Flashcards on exam 1, created by daud hussein on 12/10/2016.
Created by
daud hussein
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?