4,084 Posted Topics
Re: because you don't have enough closing brackets ( } ) at the end of your class. you're missing two. add them, and it 'll work, but maybe they won't be on the right spot, didn't check for that. | |
Re: what do you mean: isn't correct. replace balance = -amount; balance -= amount; the same with balance =+ amount should be balance += amount if you want lesser lines of code: you don't need all those amount variables, you can just put balance += clapton.nextFloat(); | |
Re: where does stateMap come from? | |
Re: basically, the stack is the 'heap' on which all your (local) variables are created. if you never destroy or re-use any, just keep creating new ones, the time will come that your (limited) space on the heap is maxed out. if then, you're creating one more. bam. stack overflow. so, … | |
Re: what kind of application are we talking about? desktop? web? .. as far as I can conclude out of your post, I'm with JamesCherrill on this, and would recommend a jar file. | |
Re: I assume we're talking about a chat application you are writing? if you have a group chat, you have a 'room' in which all your users are chatting. if you want a private chat, create a new 'room' (I assume this will be much like making the public room) in … | |
Re: your method is supposed to return an Object of type HugeInterger, but you're actually returning a 2 dimensional array of HugeIntergers. I can't say anything about where you call your method, but that 'll probably be a part of it. | |
Re: looks to me like you are mixing up Java and JavaScript, which are two completely different languages. can't you just use [Code=Javascript] myTextBox.setText("text to add"); [/Code] the getElement() method should be able to help you to get the myTextBox var. | |
Re: you can store it in a String,instead of an array. you can easily get the length and character on a certain place (based on the index) of a String. the code you have now, will always continue until 16 because you tell it to. read in one String, verify the … | |
Re: how about adding a } to close the class? | |
Re: we also don't know what's in position, so it's a bit hard to test ourselves. do you have to do this using a method, btw? I think two nested for loops would be easier for a task like this. | |
Re: you do know that giving you such code would be illegal, right? | |
Re: read the post above yours. it seems this has nothing to do with the original question, and the original thread has been dormant for several years. if you want to ask us something: * start a new thread * explain what you try to do and what your code does … | |
![]() | Re: what is the actual problem, and what error message do you get? btw: [Code=Java] catch (NumberFormatException n) { System.out.println("BUUUU"); } [/Code] this will do no good at all, replace it (everywhere you have a structure like this) by [Code=Java] catch (NumberFormatException n) { n.printStackTrace(); } [/Code] |
Re: when and where you convert to long also has its influence.. | |
Re: try the same delete in a separate app, not the one you're writing it in, because you having still the reference to the file still open is most likely the problem. if you try with a separate app to remove it, you can test whether there's something wrong with your … | |
Re: [URL="http://docs.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html"]DecimalFormat[/URL] might be a good place to start looking. | |
Re: the more interesting part was the recursivity not being correct. to give a very simple (basic) explanation: a recursive method is a method that calls itself. for instance: [Code=Java] public int addTo100(int number){ if ( number < 100 ){ number += 1; number = addTo100(number); } return number; } [/Code] … | |
Re: if I read correctly: this is just what the :hover of css does, with that difference, that the dimensions of your image is in no way linked to the original image. | |
Re: there is one remark though: you only should return the user input if it was valid, null otherwise, so: [Code=Java] if (aInput.length() == 1) { if (aInput.equals("A")) { System.out.println("Valid answer: A"); } // ... your other if's else { System.out.println("Invalid answer"); return null; // since here it would be invalid … | |
Re: user io is a lot easier to learn/code than File io just let him take a look at the Scanner class and JOptionPane. | |
Re: well sure, but why do you think that would be easier? if you want to go to the next line within a String object, there's always the "first line\nsecond line" you can use as a little bit of 'formatting'. \n => n preceeded with the escape char \, forces a … | |
Re: have people know about your site. add it to your signature in your mails, ... | |
Re: [QUOTE=Marseline;1764496]Can you say more on this im really desperate for a project idea[/QUOTE] that Ãs a valid project idea. if we were doing everything for you, it would not be a project, it would more be like a download. this thread is already marked as solved, so no need to … | |
Re: use the startsWith("ro") method for rock, instead of equals("rock"). in order to make up for the IgnoreCase, [Code=Java] if (input.toLowerCase()).startsWith("ro")... [/Code] | |
Re: what do you mean 'can't find the given member'? where does GymList come from? how is the information stored in there? is found actually set to true? (does he ask for a new weight?) | |
Re: better to check that in the OS user management tools itself. | |
Re: use the int getInt(int columnIndex) Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language. method of ResultSet. | |
Re: maybe a bit late, but: CSS is ment to deal with the layout. a table is ment to place certain data together, in the structure of a table. | |
Re: to add a comment box itself, html will do. as for handling the text, java, javascript, ... there are lots of ways out there to get that done. | |
Re: I assume he's reading the lines instead of int's. just use the split method of the String class, you'll get an array of Strings which you can easily convert | |
Re: if you read your file using bufferedReader, add +1 to a counter for each line in the file. | |
Re: I think you may want to take a look at the KeyListener and KeyEvent classes. | |
Re: I think the setOptions method of the JOptionPane might help you out there. just check the [URL="http://docs.oracle.com/javase/6/docs/api/javax/swing/JOptionPane.html"]api's[/URL]. another way is to create separate JFrames, that way you can code the entire layout, which might be easier in some cases: you'll have complete control over which element is where in your … | |
Re: [QUOTE=dantinkakkar;1763577]As for printing to files is concerned, just adopt a specific file format and save as per it keeping in mind that you have to read it later. [/QUOTE] what do you mean by this? he already chose to use '.txt' I assume he'll be reading it through the application … | |
Re: do you think it will break down soon? what you want to know is: how long will I be able to play the latest games with this setup? that would depend on what games you play, what new technology will be released and whether or not you are able/willing to … | |
Re: still have an error is a pretty vague description. and yes, off course you're getting an error there. your puzzle variable isn't a two dimensional array, it contains one. add a getPuzzle() getter to your Sudoku class, and change: [Code=Java] for ( Cell [] myPuzzle : puzzle ) [/Code] to … | |
Re: that is the question. what is your response on it? we're not going to write the entire code for you, just try and we'll help you work out the errors. | |
Re: also: depending on your IDE to 'auto-complete' your code is a crappy way of writing applications. better taking a few seconds longer, but knowing and understanding what you wrote when compared to knowing 'NetBeans(/Eclipse/...)' 'll solve the problem for me. | |
Re: what you also could do .... tell us: 1. what is the desired output 2. what is your actual output 3. is the code running or crashing? 4. do you get any error messages? ... | |
Re: [QUOTE=dantinkakkar;1762774]Whoa dude. You expect me or anyone else for that matter to go through this? And you've not even placed any comments![/QUOTE] he didn't place comments because, as he said himself: it's not his code. it's some code he has "downloaded it from net" | |
Re: you should take a look where you are allowed to put a throws statement: [Code=Java] <AccessModifier> <ReturnType> methodName(<MethodParams>) throws ExceptionThatMightBeThrownInThisMethod{ <MethodBody> } [/Code] also, since you are working in your main method: don't add a throws clause, or put a throw ...Exception in your code. The main method is the … | |
Re: and don't be rude. if you keep comparing it with != it will compare whether or not those objects are linked to the same reference in your memory, not whether they have the same value. just test this: [Code=Java] String aa = new String("a"); String ab = new String("a"); if … | |
Re: and what do you mean, you can't call a void method? either you make it a void method and have the variable whose value you are setting on either class or instance scope, or make it a method that actually returns the result of your calculation. | |
Re: not one that I used anyway (but I've only used java professionally) why do you need something like this anyway? | |
Re: well, you may want to be a bit more specific: are we talking about a commercial, or a personal site. are you willing to pay for it? do you mind adds? what language is it written in (yes, this can have an effect) does your website has a title that … | |
Re: well, just do a quick google search on 'java bubblesort'. it's quite easy and you'll find enough examples that 'll help you solve this in no time. | |
Re: no offence, but what exactly is your problem? also, why do you declare your argument as final? and why, if one of them is a final, do you give it the same name as your instance variable? yes, been up late ... yes, had a lot to drink ... no, … | |
Re: what you could do is create a class ValidCombo, which has two int instance variables. then, create an array of 'valid' combinations. for instance: [Code=Java] ... // instance var ValidCombo[] valid = new ValidCombo[3]; ... // in your main valid[0] = new ValidCombo(1, 1); valid[1] = new ValidCombo(1, 2); valid[2] … | |
Re: what makes you think your code runs twice? can you give an example of the input you've given, and the output you actually expect for that input? |
The End.