• Post Reply Bookmark Topic Watch Topic
  • New Topic

Issue with constructor  RSS feed

 
Tiberius Marius
Ranch Hand
Posts: 115
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



I don't understand why it get the errors that i get , both constructors seem correct to me but i m new to the concept .

The errors i get are :

Library.java:18: error: ')' expected
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: illegal start of expression
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: ';' expected
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: not a statement
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: ';' expected
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: ';' expected
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: not a statement
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: ';' expected
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: <identifier> expected
this(String t , String a , int n ,String p , int y ,true);
^
Library.java:18: error: illegal start of expression
this(String t , String a , int n ,String p , int y ,true);
^
10 errors
 
Matthew Brown
Bartender
Posts: 4568
9
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you're declaring a method or constructor you need to give the types. But you aren't declaring it there, you're calling it. Do you normally call methods like that? Constructors are no different.

Or, what's wrong with this line?
 
Tiberius Marius
Ranch Hand
Posts: 115
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it , thanks for the help .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!