• Post Reply Bookmark Topic Watch Topic
  • New Topic

Final Beatbox/musicserver problem  RSS feed

 
Jamie Laurent
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have nearly finished finding all the issues in my code yet this last one has me stumped..





C:\Javaapps\midiplayer>javac MusicServer.java
MusicServer.java:50: error: package serverSock does not exist
Socket clientSocket = new serverSock.accept();
^
1 error

I cant for the life of me figure out what the problem is?
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jamie,

One way that you can help others help you is to wrap your java in code tags. It's much easier to read that way, and more people will help you.

John.
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have the name of a local variable after new; new should be followed by the class name, so the compiler thinks you have the package name and gets stuck at that point.
 
Jamie Laurent
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code tags would be done how? i will keep it in mind for future issues.

so the book is wrong? i typed it right from the book and that is how it is typed.. what is the proper fix for it? remove new?
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jamie Laurent wrote:code tags would be done how? i will keep it in mind for future issues.
I have edited your post and you can see how much better it looks. Push the code button; the dropdown list to its left will usually read “Java”, and put your cursor in the gap between ] and [
so the book is wrong? i typed it right from the book and that is how it is typed.. what is the proper fix for it? remove new?
You sure you have copied it correctly? Which page is it on?
 
Jamie Laurent
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Man, now i feel dumb. I must have moved the new from the line below to one above.. thanks for the help. i will put my stuff in the code tags when needed now. thank you again.
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think nothing of it. I have spent this afternoon going through the “Java in General” forum and come back two hours later to find I have misunderstood every question I answered. Everybody does that sort of thing.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!