4,084 Posted Topics

Member Avatar for Saboor880
Member Avatar for peter_budo
0
183
Member Avatar for ThisIsMeOrIsIt

ChaiNeeys: this is a three year old (Dead) Thread. let it rest. If you have questions of your own, post them in a new thread. If you want to see the output of the above code, run it.

Member Avatar for stultuske
1
322
Member Avatar for noobjavacoder

A "SORTED" List is already sorted, that's why it's called a 'sorted' list.

Member Avatar for JamesCherrill
0
248
Member Avatar for Trevor_5

So, basically, your thread is about telling us you have a snippet of code? There's no question?

Member Avatar for stultuske
0
164
Member Avatar for Biz_1

So ... what do you think it is? You do realize it would only take you half the time it took to post it here, to actually test what the outcome would be, right?

Member Avatar for Biz_1
-1
265
Member Avatar for divinity02

again: this entire block else if(playerage >= 8 && playerage <= 13) { System.out.println(playername+" come let's play"); //this is indicating that the user can play after inputting the correct age } can be replaced by: else { System.out.println(playername+" come let's play"); //this is indicating that the user can play after …

Member Avatar for JamesCherrill
0
279
Member Avatar for LibraryCode
Member Avatar for JamesCherrill
0
303
Member Avatar for divinity02

start with re-reading your code, and remove all that is making it less readable / efficiĆ«nt. else if(userage >= 8 && userage <= 13) { System.out.println(username+" come let's play"); //this is indicating that the user can play after inputting the correct age } Since all other flows are covered by …

Member Avatar for Taywin
0
352
Member Avatar for nadiam

You don't really need arrays as far as I see. What you need are a few variables: a counter, to count how many (valid) inputs were read, the sum of those, and later you calculate the median by those.

Member Avatar for JamesCherrill
0
165
Member Avatar for nadiam

try with changing this: case 5 : System.exit(0); default : System.out.println("Please choose between 1 - 5 only."); to case 5 : break; default : System.out.println("Please choose between 1 - 5 only."); and put the `System.exit(0);` statement after your while loop. I don't really see why your code doesn't work (immediately), …

Member Avatar for Violet_82
0
289
Member Avatar for noobjavacoder

This isn't working, because this will not compile. Java is case sensitive, meaning 'switch' and 'Switch' and 'case' and 'Case' are not the same things.

Member Avatar for stultuske
-1
160
Member Avatar for gavriela

well ... you're declaring keyboard twice, removing one of these 'll remove your first problem. after this, you also forgot to declare number as an int. if you adapt these two things, you're a lot better of, but you'll see your logic does not yet do what you want, but …

Member Avatar for stultuske
0
5K
Member Avatar for divinity02

Your problem is that you don't update the value of 'i' anywhere in your while block. This causes the loop to be repeated endlessly. When handling your 'incorrect answer', there you have a break statement, which breaks out of the loop. so: either update the value of i, or add …

Member Avatar for divinity02
0
448
Member Avatar for Violet_82

the UI is the last (and least important part) you should work on. Does your code work if you don't use a UI?

Member Avatar for Violet_82
0
603
Member Avatar for katie6580

what do you pass as arguments to your application? What do you expect it to do, and what does it do (not) ?

Member Avatar for Rahul47
0
178
Member Avatar for LibraryCode

I see no statement updating your db, so it's no wonder your DB isn't updated.

Member Avatar for stultuske
0
303
Member Avatar for James 90
Member Avatar for shamuh2021

Decide what type of development you want to do. This is quite important, since not every programming language is (as) suited for every programming task. The best way to start is to look into the official documentation, the official tutorials, and to buy a good book and start from the …

Member Avatar for shamuh2021
0
259
Member Avatar for noobjavacoder

what exactly is it you are unclear about? First you say you have "perfectly good working code", later, you say "I know its incorrect". Either it is perfeclty good working, or it is incorrect. What is incorrect about it? Do you get an exception? is it compile/ runtime? do you …

Member Avatar for Taywin
0
245
Member Avatar for Violet_82

one reason why a lot of people will ignore .jave, .class or .jar files (or other extensions from other languages): you don't actually know what the code does or will try to do on your system, and it might not be something you want it to do.

Member Avatar for Violet_82
0
666
Member Avatar for dcampbell

you don't just mix html files and Java. You would need jsp or jsf files for that. Maybe you would do better to post with the jsp tag instead.

Member Avatar for dcampbell
0
229
Member Avatar for Dani

Am I missing something? Yesterday, the tags were present if you opened up the subfora list with the blue button on top-right. Now, only the main titles (no tags) are present. Where exactly can we chose a tag to visit? Maybe a smaller remar (which I noticed by replying here), …

Member Avatar for Nick Evan
2
1K
Member Avatar for noobjavacoder

The answer is Neither of those. public class Vegetable { private int calories; public Fruit (int calories){ this.calories = calories; } } This won't compile. You can't have a class called Vegetable, and have a constructor (in said class) of type Fruit. This won't compile. Let's assume you meant this: …

Member Avatar for noobjavacoder
0
188
Member Avatar for LibraryCode

ok? and what is your question? by your description, it seems to me your code works and does what it should do?

Member Avatar for stultuske
0
87
Member Avatar for Niana

Your original problem is this: if you call a print statement like that, the compiler will automatically print the result of the toString method, as told by earlier posters. If you don't override (specify for yourself) a toString method, it will take the toString method your class inherited from the …

Member Avatar for JamesCherrill
0
153
Member Avatar for Bobbyj245
Member Avatar for Jack_11

you are way to vague. what do you mean: GUI ? even System.out.println("1. new"); System.out.println("2. open"); System.out.println("3. save"); System.out.println("4. exit"); can be considered as a rudimentary GUI. are we talking about Swing, JSF, JavaFX, JSP, GWT UI-binding, ... ?

Member Avatar for Violet_82
0
395
Member Avatar for Violet_82

something that might make a difference between an anonymous inner class, and a named one is, do you plan to use it for several components? if so, it would be crazy to re-write the anonymous inner classes each time you want to use it, if you can just re-use an …

Member Avatar for Violet_82
0
361
Member Avatar for Mark Louie

setText ought to do it. You can provide scrollbars, if the text would be to long to fit in the size of the area.

Member Avatar for stultuske
0
112
Member Avatar for mags11
Member Avatar for David W
0
16K
Member Avatar for Aditya0025
Member Avatar for kunal135

First you say: > I just started learning Java. directly followed by: > I need to make a chat messenger project in java for my college project. very counter productive. you would do better to first learn Java.

Member Avatar for stultuske
0
204
Member Avatar for NewOrder

reggsoft, the code is up there (points up). If you can't write it yourself, copy paste it. There is no reason to re-open a dead thread.

Member Avatar for JamesCherrill
0
3K
Member Avatar for overwraith

Sure there are tools out there to "translate" from (for instance) Java to Javascript (basically, the GWT framework generates javascript to run on the client's machine based on the Java code written by the developer) or from Java to a C variant. Does this mean it's always good to use …

Member Avatar for deceptikon
0
256
Member Avatar for Dani

I like the new design, it's a more 'natural' look compared to the older, but just a few things I noticed first time seeing it. Usually, I directly go to the java forum (through a link in chrome, not through the main page) It is less clear what the Sticky …

Member Avatar for Dani
4
640
Member Avatar for ArunSP

I'm not sure whether creating arrays for it should be considered a 'clever way' to do this. Usually, less resources used is better. Creating an array you can do without isn't necessarily clever.

Member Avatar for ArunSP
0
209
Member Avatar for hari_10

do you know what fiddler is and what it does? it's a proxy that provides information (headers) such as authentication headers. if fiddler is not active and your browser is configured to have fiddler provide certain information along with the request, the process 'll look for information that isn't there.

Member Avatar for stultuske
0
146
Member Avatar for petrickyork

what makes you think Facebook is better than Google+? they were built for different targetgroups, with different goals in mind. comparing them as being "that one is better" is ridiculous. they were not built for the same purpose, so there is no "better", they both are good for their targeted …

Member Avatar for Honeyclerkk
0
329
Member Avatar for lukaskille

* improve the number of items you offer * increase the advertisements * make sure you have better products compared to your competition * provide a better service then any other store * keep your prices low

Member Avatar for cwvps
0
353
Member Avatar for daisyy

"display audio on jsp" ... the type of application you work with isn't relevant, whether it's a standalone using swing or javafx or a webapp using gwt or jsp/jsf, the persistence is not impacted by this. "but cannot upload only upto amount of kbs" what exactly do you mean by …

Member Avatar for jwenting
0
2K
Member Avatar for minteks
Member Avatar for Taywin
0
262
Member Avatar for omer mehmood

Saranyasb: website promotion is very easy, if you want visitors only to visit once. if you want them to return to your page, you'll really have to put more effort in it. promoting a product start with making sure you have a very good product (just decent won't cut it)

Member Avatar for Sarah.Harper
-4
545
Member Avatar for Reverend Jim

the language isn't changing at all. a lot of people are just either too lazy, too uninterested, or, in some cases, too dumb to learn and use it right. it's like driving a car. if tomorrow about every driver starts to hit pedestrians with their cars, will the point be: …

Member Avatar for Reverend Jim
7
5K
Member Avatar for Dianne Watts

video? are we talking video tutorials? about it? about how to cook? are we talking about promotional video's? are you trying to simply share your favourite music clips? what do you want/need it shared for?

Member Avatar for kennethcbrown15
-1
272
Member Avatar for Vinolia

we don't know what type your objects are, so not going to talk about how to compare them. but, comparing them to 0? let's say all your elements are -1, then you'll get a wrong result. let's assume on the other hand, all your elements are positive, then each element …

Member Avatar for JamesCherrill
0
252
Member Avatar for Tanner_1

The problem you are having is indeed what syncster31 tells you. But just another advice, follow recommended naming conventions. public void setColor(String Colors) { color = Colors; } don't start variable names with a capital letter. Change the above (and all other places in your code like it) to something …

Member Avatar for JamesCherrill
0
262
Member Avatar for EarhawkPH

just an example of what you could do: Create two lists: 1 filled with questions and answers 1 empty list Each time you display a question: remove this from the first list add it to the second list Each time again: generate a random question from the first list

Member Avatar for Stefce
0
268
Member Avatar for newcoder310

it would be a possibility. If you are going to do this, I would recommend to change the public String getColor(String color){ if(color.equals(GRAY50){ return backgroundColor; } return color; } part and other stuff linking the values and the actual enum, by what Joshua Bloch recommends in his book: "Effective Java, …

Member Avatar for newcoder310
0
232
Member Avatar for hari_10

With jsp what I'm expecting is jsp and Java code, this is pure Javascript. Is it possible you haven't pasted the right code?

Member Avatar for hari_10
0
1K
Member Avatar for s.redrose

code like this is one of the main reasons I usually recommend to start moving every single line of your business logic out of your jsp files (which are really only supposed to implement the ui of the application) and into servlets. This code is an ureadable mess, so I …

Member Avatar for stultuske
0
215

The End.