• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Final Beatbox/musicserver problem

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 80644
472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80644
472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 80644
472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic