Results 21 to 22 of 22
Thread: Need Help with a class
- 10-11-2010, 12:44 AM #21
I just realized that the driver class TestSmallRoom only passes one argument to a SmallRoom object: the roomNumber variable. I have changed my constructor to:
and now my error log looks like this:Java Code:// constructor public SmallRoom( String roomNumber ) { roomNumber = null; // I was trying to initialize some variables here.. p = null; }
TestSmallRoom.java:26: enter(java.lang.String) in SmallRoom cannot be applied to (Tutor)
room1.enter(alan);
^
TestSmallRoom.java:29: enter(java.lang.String) in SmallRoom cannot be applied to (Student)
room2.enter(prakash);
^
TestSmallRoom.java:35: enter(java.lang.String) in SmallRoom cannot be applied to (Student)
room1.enter(bill); // rejected since already occupied
^
TestSmallRoom.java:46: leave(java.lang.String) in SmallRoom cannot be applied to ()
p = room2.leave();
^
TestSmallRoom.java:52: enter(java.lang.String) in SmallRoom cannot be applied to (Student)
room3.enter(bill);
^
TestSmallRoom.java:54: leave(java.lang.String) in SmallRoom cannot be applied to ()
room4.enter(room3.leave()); // Bill moves from room3 to room4
^
6 errors
- 10-11-2010, 01:15 AM #22
Similar Threads
-
Dynamic loading of a class (passing class definition over the network)
By eddie-w in forum Advanced JavaReplies: 8Last Post: 04-14-2010, 05:49 AM -
[SOLVED] How to pass information from child class to parent class
By pellebye in forum New To JavaReplies: 7Last Post: 05-06-2009, 12:42 PM -
problem in accessing array values of one class in to jframe class
By cenafu in forum AWT / SwingReplies: 8Last Post: 03-21-2009, 09:34 AM -
Calling a method on original class from created class
By kpedersen in forum Advanced JavaReplies: 4Last Post: 08-20-2008, 12:25 AM -
Able to find class file in WEB-INF/classes but not after add sub folders in class dir
By vitalstrike82 in forum Web FrameworksReplies: 0Last Post: 05-13-2008, 06:16 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks