Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Another One of Those "Symbol Not Found" Questions  RSS feed

 
Mitchell Huo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys, this is my first post, so if I break any secret programmer's forum codes, please let me know. Anyways, I'm making a server that waits for connections, gets responses from that client, and writes information through the sock to the client. I made four classes/threads total: Global, Troy, KeyListener, and PortListener. The first is just for global variables, the second listens for incoming connections and hands them off to the PortListener, which listens for responses, and the KeyListener listens for commands from the console.

However, I keep getting this pesky compiler error:



Any help would be sincerely appreciated. Oh, and here's my source:

 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This is not a constructor just a regular method. So you only have the default constructor.
 
Greg Brannon
Bartender
Posts: 563
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to go out on a limb and say that ALL of the code you wrote intending to be constructors are methods instead, because they specify a return type. Constructors don't specify a return type, not even 'void.'
 
Mitchell Huo
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, thanks guys. Sorry, like I said before, I'm new to programming. And not to make excuses, but I started at 10 and finished and midnight. I think my brain was a little fried.
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a result, you get only the default constructors which have no parameters.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!