Length is a method, not a field. the correct way to get the length of studentID is studentID.length() not studentID.length
You can look at the String documentation here: String (Java Platform SE...
Type: Posts; User: DavidFongs
Length is a method, not a field. the correct way to get the length of studentID is studentID.length() not studentID.length
You can look at the String documentation here: String (Java Platform SE...
This is not true. Would have to see all of his code to know the reason. I would guess that the object that contains the method, that contains that code, is extending JFrame (or extending something...
That, and you also had assignment errors.
While you are right that mistakes do happen, they don't happen if you TRY it first. Which is incredibly simple to do. Instead, by being lazy, you are...
javapenguin: You posted code that doesn't compile. Why do you insist on continuing to do this?
OP: The code you posted compiles just fine for me. Compiling AccountTest.java alone should do all...
1. You should reread the Generics section of the java tutorials. Generics can get complex, and it doesn't hurt to read this section many times to ensure you understand them and are using them...
Actually in this case, it does mean that they are the same object in memory. JButton inherits its .equals method from Object. By the definition of the equal method in the Object class, .equals will...
How is spoonfeeding the guy the answer better than linking him the javadoc and letting him figure it out? There is value in learning how to read a javadoc.
There is no implicit variable named input that holds user entered input.
You can use the Java class Scanner (Java Platform SE 6) to read in input (That's a link). There is an example in the...
And if it was null, you would never make it to that null check, because a NullPointerException would be thrown when you called close()
Ran unchanged for me. Please post how you are attempting to run your code, and any errors.
Think about it this way. Right now you initialize an int variable to 1, then if you determine the number isn't prime, you assign that int variable to 0. Later in the code, if that int variable is 1,...
When I run the code you have, replacing the equalsIgnoreCase with what you have commented out on the same line, it runs as expected.
you need to change grid = new color[width][length] so that it is creating a 2d array of JButtons. Right now it is trying to create a 2d array of colors
Grid is a 2D array of JButtons. You assigning a 2D array of color objects to it. This will cause a compiler error.
You import Color and color. I'm pretty sure you want to use Color (you are...
While what you have now may work, I would make the following changes:
1. All class names should begin with a capital letter.
2. The variable f should be a boolean, for readability.
3. When...
What does that have to do with the syntax?
EDIT: Didn't notice there was a second page. KevinWorkman is on it.
You are. e.getComponent() returns an object of type Component. Without the cast, there is a compiler error
When you compare answer to "yes" or "no" you should use the .equals() or .equalsIgnoreCase() method from the String class
== checks the equality of the references. .equals() checks the equality of...
On other OS's based on linux/unix (like OS X is) I've used the command dos2Unix to remedy this.
Not sure if that command comes standard with OS X or not, but if not you can probably add it.
I have some things I don't understand
1. Why did you post incorrect code?
2. Why did you define a variable in the constructor, that is never read locally, which generates a warning?
3. Why...
You can use your same values for replacement, you just need to make sure you only replace characters that were originally in the String to be "encrypted"
This can be done many ways. The simplest...
Seems pretty obvious.... Although your original code is nowhere to be found in the post that contains "all" of your code
Lets say the original String was something simple like "a"
The first if...
From your original post, its obvious you are using Windows to do this. On a windows system, what you are trying to do will fail if a file already exists with the name you want to rename the temp...
renameTo(File dest) returns a boolean that indicates whether the rename operation was successful or not. I would recommend checking this return value to determine what behavior you should expect.
...
This is some of the worst advice I have ever read in my life