| Author |
Message |
|
|
Remember that Java is case sensitive - there is no event class but there is an Event class.
And just some feedback - do yourself a favor and name your variables like a human is going to read your code. It doesn't cost anything to name your variables in a way that makes sense - 'a' is far harder to figure out than something like actionListenerEvent.
|
 |
|
|
|
Just run it - I'm missing the issue.
|
 |
|
|
|
And your question is?
|
 |
|
|
Remember that when you accept() a connection you communicate on that Socket, not the ServerSocket. So the traditional way is to have a thread to handle each client. I started a how to on this years ago - I should finish it but basically you'll spawn a thread for each clientSocket and handle the client that way. The thread can live as long as your protocol wants - usually for the life of the conversation.
|
 |
|
|
|
Well, you've successfully posted your homework assignment - if you don't know even the first step then it's time to talk to the instructor. Take it one step at a time an let us know where you get stuck.
|
 |
|
|
It looks like all you have to do is change the "image" param to be a different image. I would think that Javascript would be one way to do this - you could dynamically change the parameter from a list of known images each time the page loads. Or, perhaps simpler, depending on your server side language (JSP, PHP, etc.) you could put a value in there at page generation time from a list of known images.
What is your server side language?
|
 |
|
|
|
Well, you've done a great job posting your homework assignment - what do you need help with? What have you done so far? This is a help forum, not a do it for me forum.
|
 |
|
|
Not with the current way you have main() coded. You would need "getters" for those variables:
And, if you want to be complete - you'll need "setters" too so that if I have an instance of an AlexHouse1 class then I can set the height and so on.
|
 |
|
|
No, it would just be simpler to have two separate files: AlexHouse1.java LivingRoom.java: The other thing is that the "protected" keyword is important to understand when using inheritance. With it your LivingRoom class would be much simpler: AlexHouse1.java: LivingRoom.java: In this way the parent class "holds" all of the data and the derived class just changes what it cares about.
|
 |
|
|
Remember that only your main() method is really "run". You're also making your life a bit harder by having the classes embedded but I was able to get this to work with:
|
 |
|
|
|
I'm not sure what you're looking for - are you stuck on anything specifically?
|
 |
|
|
I feel like you didn't read the assignment as I can't see anywhere that you're trying things like:
f(x) = x2 – a
or
f ' (x) = 2 * x
where in your code are these equations? What was the threshold value? (hint - you're off by a factor of 100). This has nothing to do with Java - it has to do with reading the assignment.
Nevertheless, you're likely to want something like:
This is very simple stuff if you've read the assignment. There are several other ways to code this but the basics are already given to you in the doc file.
You got the answer this time. Next time read the assignment.
|
 |
|
|
The syntax you show won't work. Think in terms of objects that are protective of what they share. So an object, if it wants to share something, exposes a public API that lets you change that something.
In other words:
|
 |
|
|
I might change the processing a bit:
Presumably enterCheat would let the user enter a cheat code and return. They could then start the game, quit or enter another cheat code.
|
 |
|
|
|
I would guess that this is a problem on their end - it doesn't look like an issue on your system.
|
 |
|
|