I am not sure how to delete this thread, but I essentially posted an answer to an assignment and that wasn't my intent.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
I am not sure how to delete this thread, but I essentially posted an answer to an assignment and that wasn't my intent.
Last edited by hjherron; July 16th, 2020 at 01:25 PM.
Please explain what you tried to do and what happened. Post the full text of any error messages.I can't fill in the "engine" argument.
If you don't understand my answer, don't ignore it, ask a question.
Using the code I have above it requires three arguments the make, model and Engine. Engine is an object not a string or a double or anything like that so I can't type anything in that area (the last spot after the comma in Accord)
Car car1= new Car("Honda","Accord","");
I'm not getting an error code, other than "expression expected"
The assignment says: Note engine is an object of the Engine class.
Where is the definition for the Engine class?
Why does the code define a variable: Engine as an instance of the Objects class. The code should NOT be using the Objects class.
The variable engine(Not Engine) should be defined as an Engine object, not an Objects object.
If you don't understand my answer, don't ignore it, ask a question.
Good.I think I have it fixed now.
Please be sure to use proper code tags when posting code. I added []s to your attempt at tags.
http://www.java-forums.org/misc.php?do=bbcode#code
If you don't understand my answer, don't ignore it, ask a question.
hjherron (July 16th, 2020)