Skip to document

CSC 2660 Final Review 6

Included here is review material for the final exam
Course

Object Oriented Programming (Formerly Csc2650) (CSC2660)

90 Documents
Students shared 90 documents in this course
Academic year: 2021/2022
Uploaded by:
0followers
533Uploads
15upvotes

Comments

Please sign in or register to post comments.

Preview text

FINAL REVIEW 6

Method Design

This section explains many things about methods. The first thing is that when it comes to designing a method, doing that will determine how a specific class will be able to define the behaviors of the method being designed. Another thing about methods is that they can be in something called an algorithm which is basically a step process that is used for solving problems. Methods involved in algorithms determine how the method that is involved will accomplish the goals/tasks that it has.

Method Decomposition Due to objects not being able to be implemented by only using one method, a method will need to be turned into multiple methods by decomposing it so the object can be implemented. Usually when a specific method turns into a complex method it should be decomposed to allow the program design to be more better and also a bit more organized.

Method Parameters Revisited In Java, all parameters are usually or mostly passed on by a value which can make it a problem when it comes to wanting to pass parameters into a method. Reason for this problem is since passing into a method will result in changes done into the parameter. Parameters aren’t the only thing that is passed through a method but also class objects. When objects are passed into a method, usually the object’s reference is what is being actually passed through the method. Another thing that is also explained here is that any object that is passed to a method will usually result in both the actual parameters and also the formal parameters to become aliases.

Any value that happens to get copied through this passing is usually copied to the address of the object. Something to consider is that any final value that goes through method passing will usually be printed when they return for the method. Also any primitive integer that goes through this method passing will not have its original value changed since the actual change was only made to the copy of the primitive integer that was inside in the method.

Was this document helpful?

CSC 2660 Final Review 6

Course: Object Oriented Programming (Formerly Csc2650) (CSC2660)

90 Documents
Students shared 90 documents in this course

University: Aurora University

Was this document helpful?
FINAL REVIEW 6
Method Design
This section explains many things about methods. The first thing is that when it comes to
designing a method, doing that will determine how a specific class will be able to define the
behaviors of the method being designed. Another thing about methods is that they can be in
something called an algorithm which is basically a step process that is used for solving
problems. Methods involved in algorithms determine how the method that is involved will
accomplish the goals/tasks that it has.
Method Decomposition
Due to objects not being able to be implemented by only using one method, a method will need
to be turned into multiple methods by decomposing it so the object can be implemented. Usually
when a specific method turns into a complex method it should be decomposed to allow the
program design to be more better and also a bit more organized.
Method Parameters Revisited
In Java, all parameters are usually or mostly passed on by a value which can make it a problem
when it comes to wanting to pass parameters into a method. Reason for this problem is since
passing into a method will result in changes done into the parameter. Parameters aren’t the only
thing that is passed through a method but also class objects. When objects are passed into a
method, usually the object’s reference is what is being actually passed through the method.
Another thing that is also explained here is that any object that is passed to a method will
usually result in both the actual parameters and also the formal parameters to become aliases.