Forums Register Login

Final Beatbox/musicserver problem

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
 

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?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
This guy is skipping without a rope. At least, that's what this tiny ad said:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 782 times.
Similar Threads
Client disconnected from server after about 10 minutes of inactivity
ServerSocket's accept()
Java Head First Client Server Example
ServerSocket to SSL
What type should i cast?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:50:23.