User Tools

Site Tools


qtr_1_study_guide

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
qtr_1_study_guide [2019/10/04 13:09] frchrisqtr_1_study_guide [2019/10/04 13:13] frchris
Line 9: Line 9:
 Things to watch out for: Things to watch out for:
   - Constructors should initialize the class' fields  (fields are ''private'', to encapsulate)    - Constructors should initialize the class' fields  (fields are ''private'', to encapsulate) 
-  - **Do not** use the type in the constructor- this accidentally makes a local variable instead of initializing the classes field that has the same name.+  - When initialzing fields in a constructor, **Do not** mention its type- this accidentally makes a local variable instead of initializing the classes field that has the same name.
   - Remember to make fields ''private'' and methods ''public'',    - Remember to make fields ''private'' and methods ''public'', 
   - Remember local variables are **never** public nor private   - Remember local variables are **never** public nor private
Line 19: Line 19:
   - **Do not** assign a value to a parameter inside a method unless you are asked to (also a AP scoring penalty called **Destruction of data**)   - **Do not** assign a value to a parameter inside a method unless you are asked to (also a AP scoring penalty called **Destruction of data**)
   - **Never** use ''return'' in a constructor   - **Never** use ''return'' in a constructor
-  - **Do not** ''return'' something when writing a ''void'' method ( a method that isn't supposed to return something (This too has a AP scoring penalty) 
   - Remember to ''return'' something of the same type as a method's header.    - Remember to ''return'' something of the same type as a method's header. 
-  +  - **Do not** ''return'' something when writing a ''void'' method ( a method that isn't supposed to return something (This too has a AP scoring penalty)
    
 Finally, please remember to get a good night's rest and a healthy breakfast! Finally, please remember to get a good night's rest and a healthy breakfast!
 Good Luck! Good Luck!
qtr_1_study_guide.txt · Last modified: 2023/10/09 09:23 by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki