I am taking classes online and we only have text to read. I don't really understand that so I was wondering if someone could help me with this so I have something visual to look at.
1. Write the statement(s) necessary to create a public class named Car. Include the declaration of two class variables: model and make both of type String. What is the filename for this class?
2. In your own words, explain the purpose of a constructor. Write the statement(s) necessary to create a constructor for the Car class that sets the model and make variables to the arguments supplied. What keyword is used to invoke a constructor?
3. Write the statement(s) necessary to create get and set methods for the model and make variables.
4. In your own words, explain the purpose of the main method. Write the statement(s) necessary to create a main method. (5 points)
5. Write the statement(s) necessary to declare a variable of type Car (make: Ford, model: Expedition).
10/08/2010 - 11:39
Let's start with problem 1. Instead of just answering your homework problems for you, respond with what you think the answer is and we'll work from there.
Add Comment
[language] [/language]
Examples:
[javascript] [/javascript]
[actionscript] [/actionscript]
[csharp] [/csharp]
See here for supported languages.
Javascript must be enabled to submit anonymous comments - or you can login.