Free Essay

Object Oriented Programming Definitions

In:

Submitted By thebossvince
Words 601
Pages 3
00054707
Encapsulation
Encapsulation in Java is where data and variables are wrapped and grouped together by using methods. The variables of the class will be hidden initially and will only be displayed if the method of the same class is utilized
Two things must be done to achieve encapsulation * Declare the variables of a class as private. * Provide public setter and getter methods to modify and view the variables

Inheritance
This is where a class that is derived from another class is called subclass and inherits all fields and methods of its superclass (the main class) Variables and methods can then be added to the subclass as fit. The inheritance is also one way meaning that the superclass cannot inherit from the subclass

Class Sandwich {
}
Class sub Chicken extends Sandwich {
}

Polymorphism

Polymorphism is the ability of an object to take on many forms. This can be where a child class is created and extends a parent class to inherit their common variables and add new variables to match the requirements
Public interface Food {}
Public class Burger {}
Public class Bigmac extends Burger implements Food {}

Class
A class is a blue print from which individual objects are created and modified. There are three type of variables
Local variables: Variables that are defined inside method
Instance variables: Instance variables are variables within a class but outside any method
Class variables: Class variables are variables declared with in a class

Interface
An interface is a reference type in Java and is made up of a collection of abstract methods. A class implements an interface and inherits the abstract methods of the interface. It can never be declared only implemented

Public human {
Public void eat ();
Public void drink (); }
Object
This is a representation of a real world entity Objects have states and behaviours. For example a human has states - name, race as well as behaviours –talking, eating etc. An object is also an instance of a class.
Public Shivam ( String name, String age){
System.out.print(“My name is” + name + “And my age is” + age);
}

Constructor
Generally used in classes, if the programmer does not create a constructor for the class there is a default one. Objects use this in their creation and needs to invoke the constructor public class Dude { private String fname; public Doctor ( String fn) { fname= fn; }
Instance variables: Instance variables are variables within a class but outside any method public class Dude2 { private int age; private String fname;
}
Class variables: Class variables are variables declared with in a class public Doctor ( String fn, int ag) { fname = fn; age = ag;
}

Exception handling Used to try a piece of code and looks out for a error. Instead of exiting the program we can edit our code to take some form of action when this error occurs public void error1 (){ System.out.print("Enter age\n"); try { int age = in.nextInt(); System.out.println(age); } catch (InputMismatchException ex) { System.out.println("Wrong format entered"); } finally { System.out.println("The finally block ran"); } System.out.println("Program continues"); }
Class Diagram (UML) Unified Modelling Language is a type of static diagram that shows the processes, classes and variables of code. It shows the relationship between classes and methods and gives insight to what private variables are available and what classes have access to them Method Overloading
Method Overloading is a feature that allows a class to have two or more methods in the same class with the same name. The variables present can be the same or differ but this is used mostly when we want a different functionally in the method (to add instead of minus)

Similar Documents

Free Essay

Macoii

...1.1 Introduction Object-Oriented Strategies Object-oriented programming embodies in software structures a number of powerful design strategies that are based on practical and proven software engineering techniques. By incorporating support for these strategies in software structures, object-oriented programming enables the manageable construction of more complex systems of software than was previously possible. The nature of these software structures has been shaped by decades of software engineering experience. The basic design strategies that are embodied in object-oriented programming are presented in the Table 1.1. The design strategies evolved as techniques for dealing with complex natural and man-made system. Because these strategies are so fundamental, they are encountered in other contexts and in other programming language forms. What is stressed here is the relationship of these strategies to the design and construction of object-oriented software. These strategies are widely supported by existing object-oriented languages though different languages may present them in different ways and some languages may support other variations of each one. For example, some object-oriented languages have additional ways of supporting generalization. The design strategies in object-oriented programming are effective for constructing software models of entities in the problem domain. In fact, some have argued that software design is largely about constructing a software model of the...

Words: 16718 - Pages: 67

Free Essay

Somewhat Student

...Colter Rohm, Steven Py 09/06/2015 Business 110 B Dr. Rich Module B A. Suppose you are a project manager using a waterfall development–based methodology on a large and complex project. Your manager has just read the latest article in Computerworld that advocates replacing this methodology with prototyping and comes to you requesting that you switch. What would you say? A: We would say no. I think it is best if the project manager to keep using the waterfall methodology. The project is said to be large and complex. The prototype methodology is more favorable to smaller scale projects because you will create and get your prototype reviewed by decision makers countless of times before you get the pass for the project. Waterfall methodology is a long process but we think it will be better than switching to prototyping because it is new and we do not have much experience with it. B. The basic types of methodologies discussed in this chapter can be combined and integrated to form new hybrid methodologies. Suppose you were to combine throwaway prototyping with the use of waterfall development. What would the methodology look like? Draw a picture (similar to those in Figures 1–2 through 1–7). How would this new methodology compare to the others? A: Attached on end of this Module. C. Look on the web for different kinds of job opportunities that are available for people who want analyst positions? Compare and contrast the skills that the ads ask for to the skills that...

Words: 890 - Pages: 4

Free Essay

Array Structure

...document, we will examine object oriented programming and the parameters of Creating an Array. What is an Array? An Array is a systematic arrangement of objects. In the field of Computer Science, they are different types of Arrays, but they all provide the same level of functionality. However, certain arrays provide an enhanced level of accommodation for the developer depending on the software language that the Coder is using. What is an object? The world around us consists of objects. These objects have a physical presence to them. Whether these objects are; people, furniture, cars or houses, they are all considered to be objects. In the business world, there are objects such as employers, employees, customers and etc. An object is a person place or thing. Therefore the name of an object is always a noun. The Definition of the Object The Behavior of the object helps us to give the object definition. In the programming world we refer to the definition in a certain way. The way that we refer to the object in this special way is called a “Class.” And inside of that class we have certain characteristics. The characteristics are called “data members” and also. The Class also has a certain behavior which we call “methods.” Defining Our Objects and Their Behavior In our Project for Programming, we have one class that we can define as it pertains to the efficiency model. “A class definition contains both data and operations.”(Introduction to Programming Logic, 2008) We can define...

Words: 511 - Pages: 3

Premium Essay

Thesis

...FACULTY OF MATHEMATICS AND NATURAL SCIENCE. 4. PROPOSED DEGREE: M. Sc. (INFORMATIC SCIENCE) 5. TITLE: Object-Oriented Systems Analysis and Design: a case of District Health Information System, Mozambique. TABLE OF CONTENTS ABSTRACT i INTRODUCTION 1 RELEVANT FINDINGS (LITERATURE REVIEW) 2 OBJECT-ORIENTED SYSTEMS ANALYSIS AND DESIGN 2 THE RESEARCH PROBLEM AND WHY THIS PROBLEM AREA 5 THE RESEARCH QUESTIONS 5 RESEARCH OBJECTIVES 6 TARGET GROUP 7 PERSONAL MOTIVATION 7 METHODOLOGY 7 BIBLIOGRAPHY: 13 ABSTRACT Many organisations are relying on software systems. Thus these organisations spend a lot of money on software systems and, to get a return on that investment, the software must be usable for a number of years. For many organisations, introducing new software implementation from scratch is a risk. This is because their requirements are not well defined or they don’t have enough expertise to understand and identifies software that can fit their problems. So, many organisations adopt software. That means they take analogy software (software developed for another organisation with the some similarities) and adopt it to fit their needs. In my research, I want to address the problems of adopting systems developed in the functional-oriented methodology and propose object-oriented systems analysis and design methodology. Mainly I would like to assess the flexibility of the structure of software and...

Words: 3840 - Pages: 16

Free Essay

Bapi

...BAPI’S Introduction to BAPIs Definition The SAP Business Objects held in the Business Object Repository (BOR) encapsulate their data and processes. External access to the data and processes is only possible by means of specific methods - BAPIs (Business Application Program Interfaces). A BAPI is defined as a method of a SAP Business Object. For example, the functionality that is implemented with the SAP Business Object type "Material" includes a check for the material's availability. Thus, the Business Object type "Material" offers a BAPI called "Material.CheckAvailability". Use To use a BAPI method, an application program only needs to know how to call the method; that is, it needs to know the method's interface definition. Therefore, when including a BAPI invocation in your application program, you only need to supply the appropriate interface information. A BAPI interface is defined by: Ø Import parameters, which contain data to be transferred from the calling program to the BAPI Ø Export parameters, which contain data to be transferred from the BAPI back to the calling program Ø Import/export (table) parameters for both importing and exporting data Structure The BAPIs in the R/3 System are currently implemented as function modules, all of which are held in the Function Builder. Each function module underlying a BAPI: Ø Supports the Remote Function Call (RFC) protocol Ø Has been assigned as a method to an SAP Business Object in the BOR Ø Is processed...

Words: 1918 - Pages: 8

Premium Essay

Object Oriente

...d1.1 Object-oriented programming (OOP) is a programming language model organized around "objects" rather than "actions" and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data. Object-oriented programming is a programming paradigm that uses abstraction (in the form of classes and objects) to create models based on the real world environment.   An object-oriented application uses a collection of objects, which communicate by passing messages to request services. Objects are capable of passing messages, receiving messages, and processing data. The aim of object-oriented programming is to try to increase the flexibility and maintainability of programs. Because programs created using an OO language are modular, they can be easier to develop, and are simpler to understand after development. The characteristics of object oriented programming are as follows: 1. Class A class is a blueprint, or prototype, that defines the variables (data) and the methods (operations) common to all objects of a certain kind. 2. Object Objects are the basic run time entities in an object oriented system. They may represent a person, a, place, a bank account, a table of data or any item that the program has to handle. Objects take up space in memory and have an associated address like record in Pascal, or a structure in C. 3. Encapsulation The act of placing data and the operations that performs...

Words: 2483 - Pages: 10

Premium Essay

Research

...1970’s: Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis."[1] It was designed and created in part for educational use, more so for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Scott Wallace, and others during the 1970s. The language was first generally released as Smalltalk-80. Smalltalk-like languages are in continuing active development, and have gathered loyal communities of users around them. ANSI Smalltalk was ratified in 1998 and represents the standard version of Smalltalk. Compiler Description Language, or CDL, is a programming language based on affix grammars. It was designed for the development of compilers. It is very limited in its capabilities and control flow; and intentionally so. The benefits of these limitations are twofold. On the one hand they make possible the sophisticated data and control flow analysis used by the CDL2 optimizers resulting in extremely efficient code. The other benefit is that they foster a highly verbose naming convention. This in turn leads to programs that are to a great extent self-documenting. The original version, designed by Cornelis H. A. Koster at the University of Nijmegen emerged in 1971. Pascal is a historically influential imperative and procedural programming language, designed in...

Words: 2326 - Pages: 10

Premium Essay

Introduction to Object-Oriented Programming

...INTRODUCTION Structured programming (known as modular programming) is a subset of procedural programming that enforces a logical structure in the programming being written, to make it more efficient and easier to understand and modify. Structured programming frequently employs a top-down design model, in which developers map out the overall program structure into separate subsections. A defined function or a set of similar functions coded in separate modules can be reused in other programs. After a module has been tested individually, it is then integrated with other modules into the overall program structure. Program flow follows a simple hierarchical model that employs looping constructs such as 'for,' 'repeat' and 'while.' Use of the 'Go To' statement is discouraged in structured programming. Structured programming was first suggested by the mathematicians Corrado Bohm and Guiseppe Jacopini. They demonstrated that any computer program can be written with just three structures: decision, sequences and loops. In structured programming coders break larger pieces of code into shorter subroutines (functions, procedures, methods, blocks or otherwise) that are small enough to be understood easily. In general, programs should use local variables and take arguments by either value or reference. These techniques help to make isolated small pieces of code easier to understand the whole program at once. PASCAL, Ada and C are some of the examples of structured programming languages. 1.1.1 Sequence...

Words: 2729 - Pages: 11

Premium Essay

Paper

...Programming Fundamentals Paper PRG/211 January 25, 2014 Reusability Recyclable codes are used to diminish the amount of time taken to create new coding projects. This also in many cases can decrease the amount of funding used by a corporation to create its products. Reusing codes in a sense is the taking of code from one product and trying to use it in another. The hope is that the person or persons creating the code will not have to heavily modify the code so as to save time and to keep the process simple. In this research paper we will discuss security within the realm of hiding code and how object-oriented programming and procedural programming methods are similar. We will also discuss code reusability and encapsulation. Object-Oriented Programming Object-Oriented programming is program writing that is designed around objects instead of actions and logic. These objects can be encoded and tried independently and then later amassed and composed to create a full program. Also incorporated in object-oriented programming is a technique termed data hiding. Programmers use data hiding to hide data inside the program. This makes it harder for hackers and other unwanted entities to gain entry to the information. This type of security comes at a cost. Programmers need be able to use additional code to hide the data. In object-oriented programming the code is made up of objects. These objects are then encoded into capsules. This gives each...

Words: 621 - Pages: 3

Free Essay

C++ Objects Solutions

...Problem, p. 25 Using cout to Display Output, p. 32 Assignment Statements, p. 59 Arithmetic Operators, p. 61 Solving the Restaurant Bill Problem, p. 72 Using cin to Read Input, p. 75 Evaluating Mathematical Expressions, p. 81 Combined Assignment Operators, p. 102 Solving the Stadium Seating Problem, p. 151 Using an if Statement, p. 162 Using an if/else Statement, p. 172 Using an if/else if Statement, p. 175 Solving the Time Calculator Problem, p. 236 The while Loop, p. 249 The for Loop, p. 263 Nested Loops, p. 277 Solving the Ocean Levels Problem, p. 299 Defining and Calling Functions, p. 306 Using Function Arguments, p. 316 Value-Returning Functions, p. 326 Solving the Markup Problem, p. 380 Creating a Class, p. 391 Creating and Using Class Objects, p. 393 Creating and Using Structures, p. 436 Solving the Car Class Problem, p. 480 Accessing Array Elements, p. 487 Passing an Array to a Function, p. 517 Two-Dimensional Arrays, p. 526 Solving the Chips and Salsa Problem, p. 567 Performing a Binary Search, p. 580 Sorting a Set of Data, p. 587 Solving the Lottery Winners Problem, p. 616 (continued on next page) Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 LOCATION OF VIDEONOTES IN THE TEXT Chapter 10 Pointer Variables, p. 621 Dynamically Allocating an Array, p. 645 Solving the Days in Current Month Problem, p. 676 (continued) Chapter 11 Operator Overloading, p. 704 Aggregation and Composition, p. 734 Overriding Base...

Words: 11246 - Pages: 45

Premium Essay

Algorithmic Programming

...What is procedural or algorithmic programming? Procedural programming is a programming methodology which divides a task into routines or procedures and process, one by one according to their relevance in task completion. Thus procedural or algorithmic programming is based upon concept of procedure call. Here procedures or subroutines are series of computational steps. It enables the programmers to specify simple interface, very suitable for reusability, and procedures are self-contained.  Because of reusability, different people can use the code written by someone. This also paves way to creation of programming libraries.   Procedural programming offers the following advantages: 1.       Ease of implementation 2.       Easier to keep track of program flow. 3.       Modularized 4.       Need less memory Disadvantage of procedural programming can be summed up as: 1.       Data is exposed to whole system. 2.       Real world object mapping is difficult. 3.       New user data type creation is very difficult. Reusability Procedural programming does achieve reusability of code within the same program as well as other programs. This is achieved by creating reusable chunk of code called procedures. Procedures can be declared and defined locally or globally inside a program. It enables the programmer to call the specific procedure at any point of the program. But here is a point to notice that local declaration permits reuse only within the local scope while a global...

Words: 870 - Pages: 4

Premium Essay

Doc Remove Delibitablement

...2,5 | 32 | Servo (Tuto) | 2,5 | 32 | Servo (Courses) | 2,5 | 32 | Algorithm (Data Structure) | 2,5 | 32 | Algorithm oriented object (Tuto, C++ Language) | 3 | 40 | Operating System (Theories and Fundamental) | 2,5 | 32 | WAN (courses + Tuto) | 4,5 | 60 | Method of Analysis 1 | 3 | 40 | Programming Workshop C | 2,5 | 32 | Software Engineering workshop (Access, VB) | 3 | 40 | Management Workshop for Science Engineer | 2 | 24 | Entrepreneurship | 1,5 | 20 |   |   |   | TOTAL | 63,5 | 832 | ------------------------------------------------- OBJECT ORIENTED ALGORITHM ------------------------------------------------- (Hands-On in Language C + +) CHAPTER I: GENERAL ON CLASS I. Notion of class • Generality of P.O.O • Incompatibility C / C + + II. Property of the member functions • Defaults • Member functions in-line • Transmission of object as argument III. Object assignment IV. Object Constructors and Destructors V. Object initialization VI. The copy constructor VII. Tables to Objects CHAPTER II: THE OPERATOR SURDEFINITION I. The mechanism surdéfinition II. The possibilities and limits of surdéfinition CHAIPTRE III: FUNCTIONS FRIENDS I. Principle of Friendship II. Independent functions of a class friends III. Other situations of Friendship CHAPTER IV: THE LEGACY I. Definition and implementation II....

Words: 2262 - Pages: 10

Free Essay

Oop Concepts with Real Life Example and Codes

...OOPS Concept with Real-world example Introduction OOP is Nothing but Object Oriented Programming.According to Wikipedia,  Object-oriented programming (OOP) is a programming paradigm that uses "objects" and their interactions to design applications and computer programs. OOPs have following features 1. Object   - Instance of class 2. Class    - Blue print of Object  3. encapsulation  - Protecting our data 4. polymorphism   - Different behaviors at diff. instances 5. abstraction    - Hidding our irrelavance data 6. inheritence    - one property of object is aquring to another property of object 1. Object Basically an object is anything that is identifiable as an single material item. You can see around and find many objects like Camera, Monitor, Laptop etc. In OOP perspective, an object is nothing but an instance of a class that contains real values instead of variables 2. Class A class is a template definition of the methods and variables for a particular kind of object. In other words, class is the blue print from which an individual objects are created. every human has eye ,so eyecolor can be considered as the property of human being which can be encapsulted as a data in our class Human class Human {     private:     EyeColor IColor;     NAME personname; }; Consider object of class of                 Human myhuman; we want set myhuman's name as "linto" and IColor as "black", For that we want methods to do that task. So need methods...

Words: 1017 - Pages: 5

Free Essay

Oop Concepts

...I got lately that intrigue me was to explain the concepts of OOPs showing C++ examples. Let's start by laying down some ground work. I assume that you are familar with the following OOP concepts; classes, objects, attributes, methods, types. If not, then this article might not be in your realm. I'd suggest starting with the basic concepts of C++ before you attempt to understand the more indepth concepts that I'll be discussing in this article. When we speak of OOP concepts, the conversation usually revolves around encapsulation, inheritance and polymorphism. This is what I will attempt to describe in this article. Inheritance Let us start by defining inheritnace. A very good website for finding computer science definitions is http://www.whatis.com. The definitions in this article are stolen from that website. Definition: Inheritance Inheritance is the concept that when a class of object is defined, any subclass that is defined can inherit the definitions of one or more general classes. This means for the programmer that an object in a subclass need not carry its own definition of data and methods that are generic to the class (or classes) of which it is a part. This not only speeds up program development; it also ensures an inherent validity to the defined subclass object (what works and is consistent about the class will also work for the subclass). The simple example in C++ is having a class that inherits a data member from its parent class. class A { public: integer d;...

Words: 482 - Pages: 2

Premium Essay

Geting It Together

...approach. The second important concept is that there are two types of development methodologies—a structured approach and an object-oriented approach. These are two separate concepts. Projects can be any mix of these two approaches, the approach to the life cycle and the approach to the methodology—predictive with structured, predictive with object-oriented, adaptive with structured, or adaptive with object-oriented. The chapter first presents and explains the differences in the life cycle approach—the predictive and the adaptive approaches. These two approaches are really a continuum and any give project may have elements of both approaches. The predictive approach to the SDLC is used for projects that are well understood and low risk. The adaptive approach to the SDLC is used for projects that are not well understood and are higher risk. Adaptive SDLCs are more iterative and allow the project team to adapt the project to changing circumstances. The other important concept that you should learn from this chapter are the difference between the two main methodologies to system development that are currently used to develop business systems: the structured approach and the object-oriented approach. The object-oriented approach refers to system development using newer object technologies that require a different approach to analysis, design, and programming. Finally the chapter concludes with a discussion of the Agile philosophy and Agile...

Words: 3771 - Pages: 16