Two Laptop Bag*
The moose likes Beginning Java and the fly likes Object() in java.lang.Object cannot be applied to.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Object() in java.lang.Object cannot be applied to.." Watch "Object() in java.lang.Object cannot be applied to.." New topic
Author

Object() in java.lang.Object cannot be applied to..

Accela Moon
Greenhorn

Joined: Apr 11, 2004
Posts: 20
I'm not sure how do I proceed from here to solve this error, please help if possible.. thanks.


Error:

[JAM --> Edited formatting to improve readability]
[ April 16, 2004: Message edited by: Joel McNary ]
Tobias Hess
Ranch Hand

Joined: Apr 06, 2004
Posts: 55

After new, change Object to the name of your class. And remember, you have created a 2d array, therefore the left-hand side of your assignment should look like this:
entryList[a][b]
HTH,
Tobias
[ April 16, 2004: Message edited by: Tobias Hess ]
[ edited to break long line -ds ]
[ April 18, 2004: Message edited by: Dirk Schreckmann ]
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Accela,
I'm not sure what you're trying to do, BUT let me tell what you can't do. You're trying to construct an Object given arguments to a constructor that doesn't exist. I think maybe you're trying to actually put those items in an array instead of an Object constructor (in which case you'll get an exception saying you have an index that is out of bounds).
Does that help? If not, let us know what you're actually trying to do with the line: entryList[i] = ... because that is where the problem is.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1821

Well, you've got two errors here.
First, you can't create a new Object with those parameters, because the Object constructor takes no parameters. What class of object are you trying to create here?
Second, you are trying to put a single Object into your entryList[i] position. Buy you've defined entryList as a 2D array, so entryList[i] really should be an array of objects. entryList[i][j] would be for a single object.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Accela Moon
Greenhorn

Joined: Apr 11, 2004
Posts: 20
Yes, I'm trying to add the contents of the object into a 2d array, how do I fix this?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258

Or the long way
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object() in java.lang.Object cannot be applied to..