713 Posted Topics

Member Avatar for predator78

You're defining functionality. What is it that needs to happen? High-level, it looks like you want a player to take a chair at a table. Okay, is that something that a player does, or something that a player does? I think it's something a player does, so it's in player. …

Member Avatar for predator78
0
195
Member Avatar for Crono
Member Avatar for mKorbel
0
114
Member Avatar for lynnajoe

Here's one problem: [CODE]if (!name.equalsIgnoreCase("stop")){[/CODE] What happens if this branch doesn't fire? What happens if I enter "stop"? Now, I don't know which is the line 63 that you mean - I can't see any reason why the line numbered 63 here:[CODE] System.out.println("Employee weekly salary: "+nf.format(employeeWeeklySalary));[/CODE] wouldn't execute. But I …

Member Avatar for JamesCherrill
0
131
Member Avatar for caut_baia

The best way to help someone who's got a bug in their code is to show them how to look at their own code and see the error. Showing them error-free code allows them to skip the step of finding it, and that aha! moment is what brings the real …

Member Avatar for caut_baia
1
171
Member Avatar for I<LateNupurGuha

Provide reason why I should do your homework for you. What if you are trying to learn java? How will you learn java if you don't do your own homework? What if the information is readily available in the extensive documentation provided by Sun? Provide examples.

Member Avatar for sneaker
0
173
Member Avatar for solomon_13000

[QUOTE=solomon_13000;1566425]Therefore when comparing a wrapper object other than Boolean using the "==" symbol it's value has to be between 0 to 255. Otherwise it will throw a false value. Am I correct?.[/QUOTE] No, not really. This may be a rule of thumb that works some of the time, but it's …

Member Avatar for jon.kiparsky
0
157
Member Avatar for kwins

Why are the errors buried in the code like that? To the OP: the value on the left hand side of the = sign must be a variable - a single variable, not an arithmetic expression or a method call or anything else. It's not an equal sign like in …

Member Avatar for jon.kiparsky
0
238
Member Avatar for bibiki
Member Avatar for bibiki
0
117
Member Avatar for AnkitKumar

[QUOTE]whether or not java is object oriented, depends on how you write your code.[/QUOTE] Agree also. The more I write, the more I see how true this is. In some ways, Java starts to seem like two languages to me - an object composition language married to an object manipulation …

Member Avatar for jwenting
1
326
Member Avatar for apanimesh061

If you're going into the wheel-building business, it makes sense to invent some wheels. If that means re-inventing them, so be it. And besides, re-inventing the engine seems like a good idea. Car companies do it all the time... If you just want a wheel for your wagon or an …

Member Avatar for jon.kiparsky
0
171
Member Avatar for sneaker

I don't see any problem with posting a pointer to useful reference materials.

Member Avatar for sneaker
0
565
Member Avatar for WASDted

[QUOTE]A warning to terrorists around the world: we will find you and kill you because now "there's an app for that." [/QUOTE] Is it just me, or is this post extremely distasteful? Not to be glad the world is rid of bin Laden - I for one take no great …

Member Avatar for Agilemind
3
549
Member Avatar for cynikal

Strictly speaking, that clause has nothing to do with deleting an account. You're talking about maintaining records of your transactions with members. That's reasonable - you don't delete from the database, you mark something as deleted. But that doesn't mean you can't delete an account - you just have to …

Member Avatar for happygeek
0
278
Member Avatar for jordan0420

[QUOTE]For languages without a dedicated forum, the Legacy and Other Languages forum is there as a catch-all. [/QUOTE] There's also mobile development. [QUOTE] I prefer not to have additional deeper levels because they tend to be ignored/unseen.[/QUOTE] Yes, or they become a hangout for the three people who wanted that …

Member Avatar for sergent
0
495
Member Avatar for WolfShield

It's a common problem with on-line "communities". The effect is actually similar to playing a slot machine - each act of checking in is a small invesment on its own (I'll just read this one follow-up, or respond to this one thread = I'll just put in another quarter) but …

Member Avatar for iamthwee
0
384
Member Avatar for The Dude
Member Avatar for Dani

[QUOTE=]However, I do need to begin by first training him, so it will probably have the opposite effect at first.[/QUOTE] Brooks' Law has not yet been repealed.

Member Avatar for The Dude
0
233
Member Avatar for atoivan

[QUOTE]i learn best by doing so i will be glad if u can add example codes to it[/QUOTE] If you learn best by doing, do. sirlink's advice is good: solve the problem for a specific case, say (1,1) and (4,4). Then solve for (x1, y1) and (x2, y2). Also, it's …

Member Avatar for jon.kiparsky
-1
119
Member Avatar for tracydo

Speaking of learning java: Methods either return a value, or they don't. A method whose return type is "void" doesn't return a value, a method with any other return type does return a value, and the value will be of that type. [CODE]public int foo() {}[/CODE] must return an int …

Member Avatar for SMITA6076
0
512
Member Avatar for thekashyap

If you're using the word "fatal" with regard to collisions, a hash might not be your best option. If you need to generate a unique ID, generate a unique ID.

Member Avatar for thekashyap
0
386
Member Avatar for Demetrius123

[QUOTE] Now I don't miss them at all, and have saved over $65,500 figuring today's prices ($6.00 per pack), or enough to buy me two new cars or a new house.[/QUOTE] Where are you living that a house goes for $65K? There's a two-bedroom condo down the street from me, …

Member Avatar for sneekula
-4
192
Member Avatar for liphoso

[QUOTE]I expected the program to update the original array but it seems to update the array that has been sorted. i tried to copy array but it does not seem to help me. how do i make sure sure that the array that is updated is the original array. Desired …

Member Avatar for jon.kiparsky
0
172
Member Avatar for Dean_Grobler

It seems to me that we're missing the point somewhat. If-chains are best when they're refactored out of your code, and switches likewise should be mercilessly eliminated whenever possible. Reflection gets you somewhere, (and James, I'm playing with some ideas to make this even easier - I haven't left the …

Member Avatar for JamesCherrill
0
290
Member Avatar for butz17

Or, perhaps more elegantly, you could use a collection of some sort (an ArrayList, most likely) to store words of the currently longest length. So now there are three cases: less than max, longer than max, and equal to max. The first is going to remain the same. What do …

Member Avatar for butz17
0
2K
Member Avatar for M!ss Takishima

This is just a guess, but I'm thinking your input String still has the carriage return or other whitespace, and so it's not equal to the comparison string ("bye\n"!="bye") instead of this [CODE]if (operation.equalsIgnoreCase("bye")){[/CODE] try [CODE]if (operation.trim().equalsIgnoreCase("bye")){[/CODE] And see if that works.

Member Avatar for M!ss Takishima
0
176
Member Avatar for newbie14

Yes, that's what readLine is. It reads a line, a line being marked by a newline character, which is what you send when you hit enter. (I presume that r is a BufferedReader - please provide these details next time, so the people who want to help you don't have …

Member Avatar for newbie14
0
101
Member Avatar for Ancient Dragon

[QUOTE=nssltd;1547974]I Agree whole heartedly massive event ;) Executed so well..[/QUOTE] They had executions? And I missed it? And here I thought it was just going to be a bunch of inbred toffs wandering around looking pleased with themselves...

Member Avatar for Lardmeister
0
176
Member Avatar for ibn_sumal

Funny, I was just reading Jon Bentley's article about Tony Hoare's algorithm for generating N random values from 1 to M. It's in the second volume of "Programming Pearls", which has some really good stuff if you're willing to read about old-school stuff. (Most of his examples are written in …

Member Avatar for jon.kiparsky
0
541
Member Avatar for Tankadin

You've got a real design problem here, in the form of count. Count is a global, but clearly it's intended to represent the number of items in the sublist passed in as a parameter. What happens if I call this method with a list as a parameter, and that list …

Member Avatar for jon.kiparsky
0
160
Member Avatar for cabosun

I have no idea whether your line numbering agrees with the numbering assigned by Daniweb, so I won't try to look at line 222 of the source here (though it's possible that it's the problem line) Here's a procedure for fixing this sort of thing: Open up your editor of …

Member Avatar for jon.kiparsky
0
343
Member Avatar for solomon_13000

"System.out.println(hm.get(new Friends("Draumer")));" You haven't overridden the HashCode method, which is what the HashMap uses to hash the objects. Since you haven't overridden it, it's using the default which I think is calculated from the object's address in memory. If you want this object's identity to be based on name, you …

Member Avatar for JamesCherrill
0
149
Member Avatar for MeandJava

This is one of those times when I wish that functions were first-class citizens in Java. I'd really like to just stick those method calls into a hash table right about now. Unfortunately, you'd have to set up a class to encapsulate that funtionality, and managing all of those Command …

Member Avatar for JamesCherrill
0
507
Member Avatar for ceyesuma

Look [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html"]here[/URL] first.

Member Avatar for ceyesuma
0
456
Member Avatar for I<LateNupurGuha

[QUOTE]e.g. in the code fragment int i; i+=2; here i gets the default int value 0 [/QUOTE] Um, no it doesn't. Not unless it's a field. [QUOTE] int i,j; for(j=100;i<j;j--){i+=2;} [/QUOTE] This won't compile, either. Did you try these before you posted this? [QUOTE]What is the sound of one hand …

Member Avatar for jon.kiparsky
0
155
Member Avatar for stranger_on_way

Okay, I'm replying as soon as possible. My reply is to say that I, for one, am not taking your exam for you. Good luck, though.

Member Avatar for mKorbel
0
91
Member Avatar for jingda

[QUOTE=Ancient Dragon;1554456]You will have to do something knightly -- like slay a dragon or something. Or an entertainer, like comedian Bob Hope.[/QUOTE] Or reach the eighth rank without being captured - though that wouldn't get you to king. You could be a queen, though. I know people who get to …

Member Avatar for Ancient Dragon
0
164
Member Avatar for imfatyourefat

Maybe it's your ASCII art, but that doesn't look like a heap from where I'm sitting. 100 can't be both a child of 1 and a parent of 3. By the heap property, if the node containing the max element of the tree is not the root, then that node …

Member Avatar for Rashakil Fol
0
193
Member Avatar for MWE_QUE

What's the error it's reporting? I can make some guesses, but it's a lot easier if I know what the problem is...

Member Avatar for MWE_QUE
0
319
Member Avatar for gangemia

Why not just start from the first of the month? If we continue to ignore holidays (or handle them as special cases) there are three possible cases: Saturday, Sunday, or other. If the first of the month is Saturday, 1st working day is Monday (the third). If Sunday, then 1st …

Member Avatar for TrustyTony
0
4K
Member Avatar for emc22

You call the method three times with the same input. What makes you expect different output?

Member Avatar for emc22
0
169
Member Avatar for qweewq22

Two things: post your code, not a link to it. Use the code-tag to format it as code. If you don't know what that means, read the intro threads on this forum, it should be in there somewhere, along with lots of other useful information. Second thing, "it doesn't give …

Member Avatar for JamesCherrill
0
163
Member Avatar for dancks
Member Avatar for patrickgormally

"Symbol not found" means you're using a name that the compiler doesn't know. It could be a variable that's not visible in this part of the code (ie, you declared something in one method, but you're trying to use it in another) or you declared a variable and you're using …

Member Avatar for patrickgormally
0
133
Member Avatar for jeffmummey@sbcg

Unless you've provided your applet with a main() method, it's not surprising that you can't run it from the command line using the "java ProgName" command. To run an applet from the command line, use "appletviewer x.html" where x.html is an html file with an <applet> tag calling on your …

Member Avatar for sirlink99
0
169
Member Avatar for FlightOfGrey

Since you have it as a String, you could get chars as needed with charAt() and convert them to an int with Integer.parseInt. Or you could conceiveably use the toCharArray method to turn it into an array of chars, and walk along that. That's probably a bit faster. I don't …

Member Avatar for jon.kiparsky
0
179
Member Avatar for jon.kiparsky

I'm not very well up on ant, trying to learn a few things about it this afternoon. Is it possible to read in values from the command-line ant call? The scenario I have in mind is this: I want to make a generic build file that would have targets for …

Member Avatar for nezachem
0
172
Member Avatar for coolbeanbob

[CODE]String strRead; int p = 0; while((strRead = readBuffer.readLine())!=null){ System.out.println("readFile first step in while"); String line1 = strRead; [/CODE] this construct sets line1 to null - could this be your problem?

Member Avatar for jon.kiparsky
0
717
Member Avatar for APCompSci

For the first question, the "super" call says "run the method defined in the superclass", so it calls Dog.act(), which prints "run" and calls "eat()". When it calls eat(), however, it calls the local version of eat(), the one defined in Underdog, which again calls back to the superclass, and …

Member Avatar for jon.kiparsky
0
2K
Member Avatar for nssltd

vi and a compiler or interpreter, mostly. Eclipse for some things, but I prefer to have my hands directly on the code. For my day job (writer) I'm putting together a suite of mostly open-source tools that are doing nicely for me. Gimp, of course, for bitmap images, Oxygen for …

Member Avatar for predator78
0
169
Member Avatar for melisko

Scanner's a good way to go. You can get the tokens one by one with next() and handle them one at a time, or you can get the whole mess as a String and parse it yourself - use nextLine() for that. Come to think of it, I don't recall …

Member Avatar for jon.kiparsky
0
274

The End.