• Post Reply Bookmark Topic Watch Topic
  • New Topic

Constructors problems  RSS feed

 
Alix Ollivier
Ranch Hand
Posts: 71
Java Linux Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having problems in my program. Can anyone tell me what's wrong with my constructors?





 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alix Ollivier wrote:I'm having problems in my program...

As a question, that is useless.

What problems are you having? Show us the message(s) exactly as you are getting them, with some guide to where they are pointing. In general, Java compiler messages are pretty good, so the chances are that if you read them carefully, you may well be able to answer your own question.

Winston
 
Ankit Dan
Ranch Hand
Posts: 47
Eclipse IDE Java MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think the problem is with


as square - third argument is not an integer array as your definition is
 
Alix Ollivier
Ranch Hand
Posts: 71
Java Linux Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright, here is the problem I get in Eclipse when I try to compile the BlueBlock Class:

Multiple markers at this line
- The constructor Block(int, int, int, String) is undefined
- Syntax error on token "[", Expression expected after this

Also @Ankit, No, sorry, square is an array in the class. I cut out most of the class to make it more readable, so that you guys wouldn't have to see all the non-essential stuff. Sorry.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need points, not points[]. We only use empty [] to identify the type at declaration, not when using the variable.

...which is why it says, 'Syntax error on token "["'.
 
Alix Ollivier
Ranch Hand
Posts: 71
Java Linux Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh. Oh.... Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!