7,116 Posted Topics

Member Avatar for Vinolia

No. Nobody here will write those mthods for you. This isn't a "we do your homework" service. If you would like to learn how to write them yourself then lots of people here will help you learn. Post what you have done so far.

Member Avatar for jwenting
-2
2K
Member Avatar for Toby_1

if(stringproduct == new problem004().reversed) == for two objects tests if they are exactly the same object (same address in memory etc). In this case these are always two separate objects. The String class has an `equals(String another)` method that tests if two Strings contain the same sequence of characters...

Member Avatar for Toby_1
0
165
Member Avatar for navjeet123

This is one of the worst questions in a long time! Is this a message that you got when trying to execute a 20 year-old Mac program on a Linux system with a dead hard disk? No? OK, then is this a message you got when you pointed your web …

Member Avatar for JamesCherrill
0
73
Member Avatar for My_1

Without knowing how your program and its data are structured, it's almost impossible to answer that question. What's the "switch" you refer to? Anyway, converting an int 1-9 into row/col values is just simple arithmetic. You need the divide operator / and the remainder operator % ps if (board[rows][cols] != …

Member Avatar for My_1
0
164
Member Avatar for Shibbir Khan

Every time you append a word you reverse the entire string, so the last word is reversed once, the previous word is reversed twice, the word before that is reversed 3 times, ... , and the first word is reversed (words.length) times. Of couse an even number of reversals is …

Member Avatar for JamesCherrill
0
167
Member Avatar for moaz.amin.37

The Oracle tutorials are very good... start [here](http://docs.oracle.com/javase/tutorial/essential/concurrency/procthread.html)

Member Avatar for JamesCherrill
0
273
Member Avatar for Stefce

Just setting x and y to to mouse's coordinates should be enough - the next timer event will call repaint which will paint the ball at that position.

Member Avatar for Stefce
0
2K
Member Avatar for laavanya

Read the [API doc](https://www.daniweb.com/software-development/java/threads/485162/jdbc-basicson-statement-interface-#post2123987) for The Connection class, setAutoCommit method.

Member Avatar for JamesCherrill
0
365
Member Avatar for Jonathan_7

This thread doesn't add up. "price" is an instance variable. The language defines that it will have a default initial value of 0.0 All instance variables are initialised to their defined default values (0, 0.0, false or null as appropriate) when the instance is first created. (NB as a primitive, …

Member Avatar for JamesCherrill
0
166
Member Avatar for Ritesh_4

Did you look at the links stultuske posted? What specifically about SimpleDateFormat are you having trouble with?

Member Avatar for Ritesh_4
0
792
Member Avatar for DkgMarine

That code contains fatal errors that prevent it from compiling, so there's no possibility of running it. Eclipse will have flagged the errors, so fix those first.

Member Avatar for stultuske
0
171
Member Avatar for moaz.amin.37

Buffered reader just has a FIFO stack of characters supplied from the underlying input stream. Each time you call read() it pops the first char and returns it to you.

Member Avatar for JamesCherrill
0
268
Member Avatar for moaz.amin.37

You can close() a Scanner, but if you are using System.in then the close() has no effect (System.in cannot be closed), so people don't bother. flush() writes any buffered output to the underlying device and allows you to continue writing to it. close() writes any buffered output to the udnerlying …

Member Avatar for JamesCherrill
0
162
Member Avatar for Slavi

There's nothing to gain by messing about with a 1D array. You can start with an array of doublets (arrays with 2 members), and add solutions to that as you find them. If you overflow the size you will need to copy to as larger array, and at the end …

Member Avatar for Slavi
0
279
Member Avatar for Kris_3

javac.exe needs a file name, but java.exe takes a class name as its parameter, so you don't add the ".class". Ie the correct command is just java apples (confusing? yes, but that's how it is)

Member Avatar for Slavi
0
522
Member Avatar for jordan.nunnery.75

You need to explain what help you need. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you …

Member Avatar for jwenting
-1
166
Member Avatar for Slavi

One small point: instead of using the mysterious 97, you can use the char literal 'a' which makes the code far more obvious, eg index = char - 'a' newIndex = (index + 5) % 26 newChar = 'a' + newIndex

Member Avatar for Slavi
0
175
Member Avatar for James_30

WIth Java 8 Oracle have implemented new date and time classes that incorporate the best ideas from previous attemepts, and draw very heavily from Joda. There's probably no reason to use Joda any more, just use the new classes that are now part of the standard Java install.

Member Avatar for peter_budo
0
779
Member Avatar for Benny_1

The code does angle calcs using 360 in one place and 2pi in another, so maybe you are mixing or confusing degrees and radians?

Member Avatar for JamesCherrill
0
200
Member Avatar for OFCLMAINrogieacuna

DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules

Member Avatar for Varunkrishna
0
356
Member Avatar for Muhammad_65

You have the right download page. For XP 32 bit use the "Windows x86" version. Don't forget to click the "accept licence agreement" button before downloading.

Member Avatar for JamesCherrill
0
387
Member Avatar for Varunkrishna

You have not restricted the type of your generic argument, so number1 and numnber2 could be any kind of object - Strings, URLs, Files, JRadioButtons... consider GenericsArithmetic<File> integerNumbers = new GenericsArithmetic<>(); No way you can expect Java to add them. You need to restrict the type, eg start with something …

Member Avatar for ~s.o.s~
0
10K
Member Avatar for sankubha
Member Avatar for silvercats

That example has all the code and extensive explanations. What exactly do you need that's not in the code or the explanations?

Member Avatar for Hiroshe
0
248
Member Avatar for Slavi

They are all three the same. Their names come from different ways of looking at and thinking about lists, but in the end they all do the same thing (remove and return the first item in the list).

Member Avatar for Slavi
0
146
Member Avatar for doha786

You can create Java File that refers to a directory just like you can for a file, ie new File(directory path). Once you've got the File object for the directory, you can use its listFiles method to get all the files (optionally matching a filter for .txt files only) in …

Member Avatar for JamesCherrill
0
4K
Member Avatar for Arvin1
Re: Java

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) …

Member Avatar for stultuske
-1
416
Member Avatar for V3N0M

You calculate the result, but you don't display it. You need to `setText` for the output display field, using the result text you have calculated

Member Avatar for JamesCherrill
0
200
Member Avatar for ADETUNJI_2
Member Avatar for Slavi
0
191
Member Avatar for Chem_1

"Getting errors" tells us nothing. If you have a compiler or runtime error message post the complete message plus the actual code it refers to. If your code is giving an incorrect result explain what result you get and what the correct result should be. If you want people to …

Member Avatar for Chem_1
0
223
Member Avatar for smartguy360

int amount = scan.nextInt(); String[] name = new String[amount]; String[] secondname = new String[amount]; Yes, that's perfectly valid sensible code.

Member Avatar for JamesCherrill
0
918
Member Avatar for Daminic24

It seems there's an error in the syntax of the `java` command that you are trying to use to run your program. Exactly what are you typing?

Member Avatar for JamesCherrill
0
212
Member Avatar for funnym3

If you want to display the output (the contents of the array at the end), and you know loops and print, then what exactly is your question?

Member Avatar for JamesCherrill
0
176
Member Avatar for AbstractEden

What you have done with the variables prices (regPrice, overnightPrice) isperfectly valid, but could be a little better. The problem is that to find out what value is used you need to look in two widely-separated places, so it's not easy for someone else to folow that code. It's much …

Member Avatar for AbstractEden
0
872
Member Avatar for Slavi

How about three actual pictures for the R/P/S ? And an animation that shows the result (eg scissors cutting paper) complete with appropriate sounds?

Member Avatar for Slavi
0
122
Member Avatar for rowen_1

How about a Game class that, among other things, has a` public` `joinGame(Player p)` method that stores each player in a private 4 element array. That class is then a place where you keep track of the Players and the state of the game. Rather than join players together directly …

Member Avatar for JamesCherrill
0
1K
Member Avatar for rowen_1

I don't know why you have started a new thread to continue this topic, but anyway, see my replies in part 1.

Member Avatar for JamesCherrill
0
297
Member Avatar for titus.k.s

titus.k.s Stop posting the same question twice. Next time you will get an infraction, possibly leading to a complete ban. Read the DaniWeb rules carefully before you post again https://www.daniweb.com/community/rules And yes, as people have already pointed out, there's no point trying to work with GUIs and databases when you …

Member Avatar for jwenting
-1
262
Member Avatar for m4mukulgarg

If you Google "writing a compiler" you will find lots and lots of tutorial material that will tell you what you need. It shouldn't be difficult to extend it to run on a server from a web browser.

Member Avatar for Schol-R-LEA
0
556
Member Avatar for aone.gaiemoabi

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) …

Member Avatar for Slavi
0
151
Member Avatar for Chem_1

Yes, they are all the old versions. Just download the latest (Luna) and ignore all the others.

Member Avatar for jwenting
0
182
Member Avatar for henryz_box

Are you trying to do this? actionPerformed ... show "busy" message do some stuff remove "busy" message if so... Everything to do with Swing (eg painting the screen, running actionPerformed methods) happens on a single thread - the "Event Dispatch Thread", or "EDT", or "Swing thread". That means that once …

Member Avatar for henryz_box
0
343
Member Avatar for Clif40RD

Assuming you asre using a JTabbedPane (if not, you should be), you can learn how to respond to a button click here http://docs.oracle.com/javase/tutorial/uiswing/components/button.html and how to work with tabbed panes here http://docs.oracle.com/javase/tutorial/uiswing/components/tabbedpane.html Look for how to add an action listener to the button, and how to switch to a specific …

Member Avatar for llaspina
0
511
Member Avatar for surya55

Think about this example. The `Comparable` interface defines a method `compareTo` that compares two objects so they can be sorted etc. Many classes implement this interface - eg Integer, String etc, and each implementation is different because the way you sort Integers is different from how you sort Strings (etc). …

Member Avatar for ~s.o.s~
1
230
Member Avatar for 2384443

You create a subclass of JPanel and override its paintComponent method to draw your image when the panel is repainted. Then add your components to the panel to display then in front of the image. Sounds complicated, but the code is quite simple. [ Here's](http://impressive-artworx.de/2011/background-image-on-jpanel/) a decent example

Member Avatar for raj.mscking
0
395
Member Avatar for Chem_1

Was that 64 bit NetBeans? What's wrong with Java 8 (the current version)?

Member Avatar for JamesCherrill
0
97
Member Avatar for niccid76

Small point: Java programming conventions prefer the use of "camel case" rather than underscores, so accountBal would be better advice than account_bal.

Member Avatar for Taywin
1
218
Member Avatar for Thurston_1

If you think about it... You need to know what all the abbreviations are before you can start processing the text file. So the overall plan needs to be: read all the abbreviations into an array or other data structure for each line in the text file search the line …

Member Avatar for Thurston_1
0
729
Member Avatar for khennxi

Before asking someone else to check your code try to compile and run it. If it runs and gives the correct answers then it's probably OK.

Member Avatar for Schol-R-LEA
-3
847
Member Avatar for desert564

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) …

Member Avatar for JamesCherrill
0
1K

The End.