



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Problem-Solving Techniques
1. Understand the problem completely. 2. Divide the problem into manageable pieces (divide and conquer) 3. Create solutions 4. Consider alternative solutions and refine the one selected 5. Implement the solution 6. Test and fix the solution Polymorphism (a general definition – having many forms) Creating a general solution for a class of problems which may be further specified to solve particular instances of the problem. Syntax A set of rules of a programming language that dictates the legal form of a program Semantics Describes the meaning of the program statements
Compile-Time Errors Errors in syntax that can be caught by the compiler. These can be fatal or non- fatal. A fatal syntax error will halt compilation at the point of the fatal error. A non-fatal error will allow compilation to continue (although sometimes not correctly). Run-Time Error Errors in semantics. This causes your program to blowup. Logical Errors Errors in semantics which do not cause a run-time error but produce erroneous results. Encapsulation A form of information hiding Keeping data and non-essential methods private. Public methods are provided to allow user interaction. Obscures or hides non-essential details and methods. Objects are encapsulated. The rest of the system interacts with an object only through a well-defined set of services that it provides. Abstraction
Each subclass has one explicit parent ONLY but inherits from all "straight line" ancestors implicitly. The original class used to define the new class is called the parent class , or superclass , or base class. The derived class is called a child class , or subclass. (Java uses the keyword extends to indicate that the new class is being derived from another.) The child class automatically inherits an initial set of methods and variables from the parent class. The inherited variables and methods can be used by the child class as if they had been locally declared in the child class. Multiple Inheritance: In multiple inheritance a subclass can inherit explicitly from an unbounded number of parent classes. Object Thing Stuff Kart Margay CRG motor Mine Compan y Chalk Books Stuffing This one
texts COP 3503 T-day dinner
This is not good in general! Why? Consider the following situation. Problems: