4.1 |
a) object. b) class. c) new. d) type, name. e) global namespace. f) instance variable. g) float, double, decimal. h) double-precision. i) ToDecimal. j) access modifier. k) void. l) ReadLine. m) using directive. n) single-precision. o) C. p) value, reference. |
4.2 |
a) False. By convention, method names begin with an uppercase first letter and all subsequent words in the name begin with a capital first letter. b) False. A property's get accessor enables a client to retrieve the value of the instance variable associated with the property. A property's set accessor enables a client to modify the value of the instance variable associated with the property. c) True. d) True. e) False. After defining a property, you can use it the same way you use a variable. f) True. g) False. Such variables are called local variables and can be used only in the method in which they are declared. h) False. A property declaration can contain a get accessor, a set accessor or both. i) True. j) False. Instance variables are initialized by default. k) True. l) True. m) True. n) False. Such literals are of type double by default. |
4.3 |
A local variable is declared in the body of a method and can be used only from the point at which it is declared through the end of the method declaration. An instance variable is declared in a class, but not in the body of any of the class's methods. Every object (instance) of a class has a separate copy of the class's instance variables. Also, instance variables are accessible to all methods of the class. (We will see an exception to this in Chapter 9, Classes and Objects: A Deeper Look.) |
4.4 |
A parameter represents additional information that a method requires to perform its task. Each parameter required by a method is specified in the method's declaration. An argument is the actual value that is passed to a method parameter when a method is called. |
Control Statements Part 1 |
Preface
Index
Introduction to Computers, the Internet and Visual C#
Introduction to the Visual C# 2005 Express Edition IDE
Introduction to C# Applications
Introduction to Classes and Objects
Control Statements: Part 1
Control Statements: Part 2
Methods: A Deeper Look
Arrays
Classes and Objects: A Deeper Look
Object-Oriented Programming: Inheritance
Polymorphism, Interfaces & Operator Overloading
Exception Handling
Graphical User Interface Concepts: Part 1
Graphical User Interface Concepts: Part 2
Multithreading
Strings, Characters and Regular Expressions
Graphics and Multimedia
Files and Streams
Extensible Markup Language (XML)
Database, SQL and ADO.NET
ASP.NET 2.0, Web Forms and Web Controls
Web Services
Networking: Streams-Based Sockets and Datagrams
Searching and Sorting
Data Structures
Generics
Collections
Appendix A. Operator Precedence Chart
Appendix B. Number Systems
Appendix C. Using the Visual Studio 2005 Debugger
Appendix D. ASCII Character Set
Appendix E. Unicode®
Appendix F. Introduction to XHTML: Part 1
Appendix G. Introduction to XHTML: Part 2
Appendix H. HTML/XHTML Special Characters
Appendix I. HTML/XHTML Colors
Appendix J. ATM Case Study Code
Appendix K. UML 2: Additional Diagram Types
Appendix L. Simple Types
Index