4,084 Posted Topics
Re: also, for readability purposes, remove all those blank lines in your code. | |
Re: not to mention the fact that you should learn to write compilable code, before trying to implement algorithms. | |
Re: You can have an abstract class without any methods, and you can have abstract methods which only contain non-abstract methods. so: 'both childclasses are having the same methods, but different execution code', not always. public abstract class Person{ private String name; public Person(String name){ this.name = name; } public void … | |
Re: > its not working do you think you could be a bit more specific? | |
Re: the actual error is, null means: there is no value assigned to the variable. so, if you call a method and ask them to parse 'null' to a numeric value, it 'll fail. No, the error can not have been thrown at line 171. it happened, as your error messages … | |
Re: It seems you had that problem, because your input was "neither an OLE2 stream, nor an OOXML stream". Check the method for what it is expecting, and make sure you pass a valid parameter to it. | |
Re: vivekH: this is an ancient (read: dead) thread. There's little point in commenting on it. | |
Re: that would depend on the datatype. especially when you are weak, you should try yourself, by just asking someone to do it for you, you won't learn anything. what have you got so far? | |
Re: you don't know how to store a String in an arraylist? List<String> arrayList = new ArrayList<String>(); arrayList.add("myString"); if it's something else that's bugging you, could you be a bit more specific? | |
Re: No. At the very least, try to do it yourself. The reason you were given this assignment, is because your teacher wants to find out whether you know how to do this. We are willing to help you improve your coding skills and understanding, not to help you cheat. The … | |
Re: You should have a class: Year, which has twelve instances of a class Month, which has x instances of class Day. in class Day you keep a List or Set of Appointments. All you have so far is GUI. You'll need actual logic to go with it, too. | |
Re: have millions and millions of people install the alexa spyware (which basically is what it is) and have them surf to your site. Personally, I wouldn't bother with Alexa ratings all that much. It bases itself on users of the Alexa Toolbar (which is far from everyone), which is only … | |
Re: Random generator = new Random(15) + 1; how could this not result in a compile time error? generator is an instance of the Random class, it is not a numerical value you can add 1 to, nor it is a String you can concatenate. What exactly is it you are … | |
Re: run a Java class from paint? that makes no sense at all. paint is an image processing application, not a coding platform. or did you mean: "is it possible to open paint from my code when I run my code through the command line?" | |
Re: This question is impossible for us to answer. We have no idea about your background or knowledge. We also have no idea what type of "game" you want to write. Are we talking about hangman 2D, or the next level in 3D shooters, but than on a small screen ? … | |
Re: well ... I would not recommend handing this in just yet. An example: public void SetCardNumber(int c) { System.out.print("Enter card number:"); String cardNum = input.next(); if (cardNum.length() >= 13 && cardNum.length() <= 16) { System.out.println("Valid Card number"); cardNumber = c; } else { System.out.println("Error: Invalid card number"); } } let's … | |
Re: what specifically are you having difficulties with? | |
Re: either minimize the code you show, or be more specific of the problem. what is the part of the code we need to focus on? | |
Re: also, what is the logic of your rotation? why doesn't the first element switch places? | |
Re: classes can't 'implement' classes, only extend them. Unless of course Car is an interface, not a class. basically, this can be done with (a bit) the same logic as ye olde "roll the dice". in here, the possible values are not "1-2-3-4-5-6", but, let's say you have an array of … | |
Re: a small remark, to make it easier: ... int loop_end = 10; for (loop_start < loop_end) { System.out.print ("Enter a number"); Number = keyboardIn.nextInt(); if ( Number >=0) { Positive ++; } loop_start ++; } System.out.print ("Positive numbers were " + Positive + "& negative numbers were " + (loop_end … | |
Re: well, since you only have instance methods, you'll need to call them through an instance, which you are actually doing `science.addToGradeBook(x);` so I don't really see what your problem is. Can you be more specific as to what it is you need help with? | |
Re: Tekkno: 90% debugging? no offence, but seems to me that if that is the case, you're writing some pretty crappy code. debugging should be held to a minimal, somewhere closer to 0%, that is. of course, that is practically impossible, but if you have a decent analysis, and unit tests, … | |
Re: TekknoDraykko: maybe you should re-check the error message. The actual text he is trying to parse into a number is: "jLabel4", that is what the exception message says. longon-G: most likely, you wanted to put a jTextField there, instead of a JLabel, since a JLabel is not really used for … | |
Re: apparently, no, it is not. either you are pointing to an other database, or a wrong table, or you misspelled the name of the table. > Column 'salary' not found. means just that. | |
Re: if(parseduserguess > numberToGuess){ result.setText("Number too high!"); }else if(parseduserguess < numberToGuess){ result.setText("Number too low"); } if you think something like this is not working (which in your case would mean that the actionPerformed wouldn't run. (or maybe, that parseduserguess == numberToGuess, just add a simple print statement right before the if … | |
Re: Niloofar: you should start by the links James provided you, since they are the official tutorials about how to use sockets, and the official tutorial on learning the language. my advise: start with the second one. > just want to know the primary form, model and shape of the way … | |
Re: I would recommend first learning to use servlets. in the end, you won't be "turning your jsp in a pdf", you'll just write the information that is displayed in your jsp to a pdf file. | |
Re: Since this seems to be an inner eclipse issue, have you tried asking it on the eclipse community fora? | |
Re: ehm .... buy more bandwith ? send out flyers or promotional emails ? | |
Re: and never do this: catch ( IOException e) { } I know, nobody likes to see error messages, but in your case, just because you don't see them, doesn't mean they're not there. you are merely hiding them. at the very least, add a print statement informing you there is … | |
Re: it runs on Windows 7. make sure you install the right version, though. | |
Re: by writing the code that 'll do all this. Just so you know, in order for the compiler to understand what it is you want your code to do, it is important that you write the correct syntax. Just as if you want us to completely understand what you are … | |
Re: also, do realize: this are Java related questions. the answers don't vary if you were to change from IDE. The fact that you are using BlueJ does not impact this at all. | |
Re: how about using substring, with the two locations you found? | |
Re: this is very basic. check [this page](http://en.wikipedia.org/wiki/HTTP_404) for more information. | |
Re: so, did you check the full stack trace in the logs? | |
Re: Reverend_Jim: no doubt that other OS have (at least) as many holes in it (although I must admit I was a bit surprised to learn so), but Microsoft has over the years managed to p*** off a lot more developers, hackers, script-kiddiez, ... then all the other combined. Next to … | |
Re: Could you post the entire stacktrace? | |
Re: I'm a bit at a loss here.. > I have '+abc' and the correct output should be 'ab+c'. If it's supposed to become a postfix, shouldn't it become 'abc+' ? Can you please explain your logic more clearly? | |
Re: take this line `//pottertr_Point pp=new pottertr_Point();` out of comment, and use this instance: for (int i=0; i<3;i++){ s="p"+i; pp.setName(s); pp.setX(getCoordinate()); pp.setY(getCoordinate()); p[i] = pp; System.out.println(p[i].getName()+", coordinate: (" + p[i].getX() + "," + p[i].getY()); } is there a reason why both x and y should have the same value? Remove some … | |
Re: Also: start with the sql part. Without it, your VB scripts won't be able to fetch or store the information anywhere. | |
Re: `if(typeofcar.EqualsIgnoreCase.("passengercar"))` that's just one of the problems. the correct way is: `if(typeofcar.equalsIgnoreCase("passengercar"))` so, remove the . and change your method call: equals and equalsIgnoreCase, just like any other method start with a lower case. | |
Re: from what I remember of your code, the . had a separate part in the actionPerformed, which you should keep. for instance, if you want to block adding the second '.' if ( ".".equals(event)){ if ( T.getText().contains(".")){ // there's already a . in the text, so end return; } // … | |
Re: Two remarks: 1. Be more specific. when is it throwing an exception, on which line, during which part of the flow? 2. Don't just copy paste code here that resembles code that you are running, show us the actual code. I know this is not the code you tried, because … | |
Re: Can you print out the actual stacktrace? | |
Re: the compareTo should help you there. but, just something I noticed: public boolean equals(Phone other) { return (name == other.name)&&(phone == other.phone); } This is bad code. What you need to do, is override the equals method of the Object class: public boolean equals(Object o){ // code } a second … | |
Re: Guide you with what? just post what you have so far and explain (clearly and detailled) what is going wrong. There are plenty people here who are willing and able to help, no doubt. | |
Re: You do realise this is not 'code-on-demand', right? There are tons of tutorials out there. as for the compiling part, why would this be any different from compiling any other application? |
The End.