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 12:58] frchrisqtr_1_study_guide [2019/10/04 13:07] frchris
Line 8: Line 8:
  
 Things to watch out for: Things to watch out for:
-  - not initializing a field ( fields are private, to encapsulate)  +  - Constructors should initialize the class' fields  (fields are ''private'', to encapsulate)  
-  - accidentally making a local variable instead of initializing a variable in a constructor +  - **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. 
-  - remember to make methods public, and don't forget to use () for the parameter list, even if there are no parameters +  - Remember to make fields ''private'' and methods ''public'',  
-  - local variables are never public nor private +  - Remember local variables are **never** public nor private 
-  - dangling else statements (p 148)+  - Remember method names should use () for the parameter list, even if there are no parameters 
 +  - Watch for dangling else statements (p 148) - without brackets, the last ''else'' belongs to the previous ''if''
   - forgetting to have a method return something of the correct type    - forgetting to have a method return something of the correct type 
   - **Do not** add a ''System.out.print'' when no printing is requested (This can be a 1 or 2 point **Extraneous code that causes side effect** penalty on the AP Exam)   - **Do not** add a ''System.out.print'' when no printing is requested (This can be a 1 or 2 point **Extraneous code that causes side effect** penalty on the AP Exam)
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