It doesn't necessarily mean that your program has some error. As I do not see any problem with the function you have written. Working with swings has always been tricky because they bahave differently on different platforms(OS). They inherit the native windowing capabilities from the underlying operating system. I would suggest you to add some debug prints and firstly figure out whether this function is at all getting invoked in full screen mode? Secondly, if your window does not gain focus, then the key press events may not get captured by your program.
you must use the absolute path or the relative path of the properties file. remember, if you are executing p1.p2.A.class then your class could be in c:\p1\p2 folder, but you will be executing it from c:\ so the path of the properties file should be either absolute path or relative path to c:\
When you add an element to HashSet/HashMap, 1) first the hashcode of object are matched against that of all other elements 2) then the object are matched with either == or .equals
And its added only when the hashcode is not same "and" == or.equals return false
So when you uncomment the hashCode method, only 1 element is added to the HashSet.
Moreover, as per definition of 'hashCode' method
If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
So, for correct operations, its your responsibility to override the 'hashCode' method if you are overriding the 'equals' method.
a) threading (in terms of handling and performance) may get affected b) native method calls may get affected c) networking related stuff may get affected d)
I don't think we can achieve IPC using Pipes and shared memory in java. Because you don't have any control over the memory management in java.
moreover unlike C++, we have 2-level referencing in java, so even if you somehow find a memory address to write the data, it won't be actual memory address where the data will be stored.
if it appears like this in your code then the return statement must have a terminating semi-colon and must be enclosed within curly braces. i.e. //Instance Variables public double enterdollars() { return enterdollars; }
Can you be a bit more elaborate when you say "run plain java classes in a server instead of a JVM"
can you be specific on "server" here. Because a server is just an application that responds to incoming requests and thus serving the clients. That server application can be a java class.
To run a java class, you need 'java' interpretter that needs jvm to execute.
Hi Rashmi, I am working in Delhi, India, but am not able to get a job good enough for my expertise.
Hi Peter, I agree with you that knowing another knowledge is always good, but how can you keep yourself rated 9/10 in all the languages you know. To get that level of expertise with another language will require another 3-4 yrs. of your career. And what if after that you are required to learn a third language.
its simple concept of local vs. global scope of variables in this example.
but of course, in line 1 and 2, there is an error...
System.out.println("myBar.barNum in changeIt is " + barNum);//1 System.out.println("myBar.barNum in changeIt is now " + barNum);//2
barNum can't be accessed as barNum, it has to be myBar.barNum So along with these 2 statements, if you print this.myBar.barNum, your confusion will go off