4,084 Posted Topics
Re: also, a remark: if(mileage > 30000) System.out.println("car needs servicing"); else if(mileage > 65000) System.out.println("car for sale"); } you can't use this system. to explain: for which value of mileage do you think it will not be over 30.000, but will be over 65.000? you'll need to add a second condition … | |
Re: make sure (or make enough people believe at least) that it is a very unique app that they can not miss from their devices, lest they would suffocate in the next 24 hours. You can't market an app based on "I have to sell it this many times". Marketing goes … | |
Re: And what exactly is it you are having trouble with at this point? | |
Re: something 'marketing-ly' ? Honestly, I have no idea. Is this an IT project you are going to work on? is it software? is it hardware? Did you check the requirements you were given? Usually, being able to decide on a project that you can complete within the deadline and with … | |
Re: Where did you get this code? By just randomly copying code you've found on the net, you won't be learning coding yourself. `for (int i=1; i<=nod; i++){` This is the opening of an iteration, a for loop. The following block will execute while i is equal to or lesser than … | |
Re: JMF is ancient. they stopped supporting it years ago. you may want to look for a somewhat more 'up to date' technology. So, you tried something, but it's not successful. Can you show us what you tried and tell us what exactly went wrong? ![]() | |
Re: also a thought: if(Character.isUpperCase(ch) && !containsUpperCaseLetter) { containsUpperCaseLetter = true; } why this second condition ? are you afraid you'll overwrite true with true ? the above can be made shorter by just putting: if(Character.isUpperCase(ch) ) { containsUpperCaseLetter = true; } one time, this isn't that much, but you are … | |
Re: What you can do to keep a history of the names: add an instance variable ( a list of names) and each time you call the changeName method, do something like this: private List<String> previousNames = new ArrayList<String>(); private String name; // ... public void changeName(String newName){ this.previousNames.add(this.name); this.name = … | |
Re: iamthwee: are you sure? I can perfectly write that without loops. | |
Re: You can very easily write applications that connect to a DB using just the Java SE JDK. but, my recommendation: if you are just starting with Java, as you say you are, you should start by learning Java. don't try to go from zero to a hundred in less then … | |
Re: the only thing I see missing is that line "Program 2 is developed by", but since you didn't coded it, it isn't missing, it's just not there yet. | |
Re: if you never worked with Java before, you'll first need to learn Java. so, inform your university that if they want code YOU actually wrote (and didn't copy paste), it might take a while. | |
Re: Way to vague, and way too little effort done yourself. We know way too little about your requirements to even start on it. | |
Re: so: long story short, you posted your assignment here. the best thing you can do, if you actually want to learn something about Java, is at least try. trial-error is a lot more efficient way to learn something compared to copy-paste. at least with trial error, you actually thought it … | |
Re: we don't know what your code is supposed to be doing, nor what it is doing wrong in your eyes. All we can comment on is what the code will be doing. If you want us to be able to be more helpfull, be more clear about what output you … | |
Re: > theres a couple things wrong with this it might be best if you told us how you know this. do you get a compile time, or runtime exception? if so, show the stacktrace. do you get an output you don't expect? then tell us what it is you do … | |
Re: you'll need to detect value changes. if it's not the default text: "select employeename from employees where department like <selectedValue>' and populate the second list. | |
Re: what is "from this point" ? What is it exactly you are trying to implement now, and what trouble do you have with it? | |
![]() | Re: Why did this thread remind me of [this](https://www.youtube.com/watch?v=N8Y1q9RqBfc)? ![]() |
Re: Nguyen: you haven't asked a question yet, how do you want us to answer it? If you mean the question asked by the OP, that has been answered. just read the previous replies. | |
![]() | Re: And your point is? If you need help with anything, post what you have so far. Just to be clear: when I say "what you have so far", in case you missunderstood it, I didn't mean "post your assignment and we'll do it for you." The rules of Daniweb demand … ![]() |
Re: my advice: learn to write your persistency code in such a way that it's not db dependent. it's much easier to work if on changing a db, all you need to do is change one single property, and not your actual code. | |
Re: newcoder: "you may instantiate but you would get a warning" ... not really. it would run perfectly, but chances are, you would confuse a developer reading your code, thinking he's working with instance methods and thus changing values for only a certain instance, not for all of them. | |
Re: you can't ... either they are random, or the possible values are limited by already existing values (in which case, they're no longer random). what you can do is add the already chosen values to a list. When generating a new value: List<Integer> already; // .. Integer newValue = getNewValue(); … ![]() | |
Re: In this particular case it doesn't matter, but some methods won't accept an array of bytes, only a String, as parameter, which is when you want to use this. | |
Re: > Now only i heard about iReport. Thats sounds great. But I couldn't implement that iReport in the ongoing project because its almost done. How do you figure that? If having a report is part of the project, it won't be 'done' unless the report is implemented. | |
Re: Yes, an exe can easily be bundled with your own code, but that does have it's implications on the server you can run it on. good luck trying to 'run' that exe on a Linux based server. ![]() | |
Re: "I am missing something" ... Firstly, we have no idea what it is you are trying to write. You also forget to mention whether or not your code compiles/runs/..., so, whether it is a problem related to bad coding, or to a flawed logic. Be specific: we don't know your … | |
Re: network configuration 'll probably help you out somewhere, or maybe not setting your firewall to block everything. just curious: since you can't get on any page, how did you manage to post here? :) | |
Re: not working fine ... can you specify this a bit ? Does it run ? Does it run the code for that button or not ? Does it produce different output ? What do you expect ? What do you get ? Have you tried debugging it ? Is the … | |
Re: By writing the code, compiling it, and running it. | |
Re: by installing the jdk on your computer. if it is installed, make sure you set the environment variables in your os (pointing to your jdk) | |
Re: firstly, don't overuse variables. if you need three, don't declare five. use meaningfull names for you variables. it might be clear to you what s and k are supposed to do, or what they mean, but I have no clue. also: write it out first. you might see it becomes … | |
Re: help you how ? by writing the code ? no. we're not coders-for-hire. what have you tried so far ? | |
Re: why did you need a second thread with an exact same question ? yes, if a variable or a method are not declared as being static, they are instance variables/methods. | |
Re: `integer.value()` is a compile time error waiting to happen. | |
Re: > their is no java programs in the computer must be because you haven't written them. and, remember, just like the english language, Java has a strict syntax you have to follow in order for the code to make sense. | |
Re: divinity: that wasn't an actual insult. he was pointing out that your code makes very little sense. for instance, the line he copied: `if(Character.toUpperCase(inputChar) ==('F') || Character.toLowerCase(inputChar) ==('f'))` Can you honestly say that you are capable of thinking of a way that the first expression (Character.toUpperCase(inputChar) ==('F')) would return false, … | |
Re: it makes perfect sense. A classname has to be one single word. public class SoftwareDevelopment { public static void main(String[]args) { System.out.println("Hello World"); System.out.println("2name"); System.out.println("name: \n"+name); System.out.println("\"name:\""+name); } } and the filename should be SoftwareDevelopment.java also, make it : `String[] args` instead of `String[]args` | |
Re: actually, what you are trying to do is not possible. you are trying to compare the value of a String to that of an int. it's like comparing a banana to the most expensive model of the latest BMW series. if you want to compare them anyway, use the sum … | |
Re: divinity: don't read noobz32 's response, or, since you did, ignore it. it is wrong. read James' remark instead. if you read it as a String, use the equals (not Equals) or equalsIgnoreCase method to compare them. if you read your input as a char, use the == operator to … | |
![]() | Re: Also: don't use StringTokenizer. It's only maintained not to break 'older' code. To quote it's api: > StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String … |
Re: you wrote this code .... what is that html doing in there? so, you need help with this ... memberShipType = JOptionPane.showConfirmDialog(null, "upgrade to 4.95?"); if (nResponse == JOptionPane.YES_OPTION) { System.out.println("User wants to upgrade");} else if (nResponse == JOptionPane.NO_OPTION) { why do you compare nResponse, which is a variable that … | |
Re: can you be just a wee bit more specific ? | |
![]() | Re: > but its too long and lengthy for a beginner to understand a good thing you are not a beginner, then. if you are a beginner, remove eclipse and learn to program without an IDE first, instead of learning to just use an ide. also: stop working on I/O material … |
Re: any help with what ? the assignment seems pretty clear. what is it you don't understand ? if you mean help as in "please gimme code", we don't do that. community rules require you to show some effort done by you. start programming. if you get stuck: tell us where, … | |
Re: with a key listener, for instance. you add a key listener that checks the input given, if it's not a number or a ., have it consume the event. | |
Re: This seems like a pretty straightforward (and easy) beginners assignment. You haven't even tried to write it on your own. Something tells me you won't find this class very easy. | |
Re: addCoin is similar to add, even if you use an ArrayList. You can also use an array, and for each .add create a new Array, with one more element, containing the new one. but just the snippet you posted above is way to little for us to know what way … | |
Re: what are you going to do if temp is "a1b1d1" ? |
The End.