ch07Sections1-5 - 7.18 Exercises Problems and Projects...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
7.18 Exercises, Problems, and Projects 7.18.1 Multiple Choice Exercises 1. The convention is to start with an uppercase lette.r 2. They must be the same name as the class name. 3. A constructor does not have a return type. 4. true 5. It can be accessed directly only from inside its class. 6. Instance variables are private and methods are public. 7. can be basic data types, existing Java types, or user-defined types (from user- defined classes) 8. used to access and modify field variables of a class from outside the class 9. no parameter 10. one parameter, of the same type as the corresponding field 11. return the same type as the corresponding field 12. are void methods 13. these fields do not need to be passed as parameters to the methods because the class methods have direct access to them. 14. final 15. static 16. All of the above 7.18.2 Reading and Understanding Code 17. accessor 18. mutator 19. double 20. String 21. a class method (keyword static ) 22. an instance method (keyword static not used) 23. double d = Airplane.foo1( "Boeing" ); 24. String s = a1.foo2( 'A' ); 25. public static void foo3( double d ); 26. public int foo4( String s ); 27. 1 7.18.3 Fill in the Code 28. private int grade; private char letterGrade; 29. public static final double FEDERAL_TAX_RATE = .07; 30. public TelevisionChannel( ) { name = ""; number = 0;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/05/2011 for the course CS 38 taught by Professor Stevehouseman during the Summer '09 term at Irvine Valley College.

Page1 / 4

ch07Sections1-5 - 7.18 Exercises Problems and Projects...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online