Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
7
Posts with Upvotes
7
Upvoting Members
7
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
Ranked #1K
~29.1K People Reached

54 Posted Topics

Member Avatar for ilovejava

A couple of notes: 1. I see no problem with [CODE] public void add(Object o){ array[this.position] = o; this.position++; } [/CODE] 2. The if-statement in your second add() method is wrong 3. You should do some check on the index in several of the methods 4. indexOf()/lastIndexOf() shouldn't return 0 …

Member Avatar for Slimmy
0
200
Member Avatar for Jessurider

[CODE] String s = "C:\\Documents and Settings\\user\\My Documents\\"; System.out.println("Before: " + s); s = s.replace("\\", "/"); System.out.println("After: " + s); [/CODE] Note the usage of [B]replace[/B], not replaceAll.

Member Avatar for Slimmy
0
71
Member Avatar for Nandomo

Well, it's not strange that you only get the last item since each call to getItems() will loop through the whole list and end up with the last element each time. Depending on the layout of your program (didn't read all of your source code, only the getItems() method) you …

Member Avatar for Nandomo
0
148
Member Avatar for shady05

Do you have a particular problem or do you just want someone to code it for you? If the latter, you're not going to get that kind of help here. Please post specific problems and show that you have tried to solve them on your own.

Member Avatar for shady05
0
126
Member Avatar for tenlrt

Short answer, No. Unfortunately it's a b**ch to print stylized text to the terminal/command prompt in Java. If you really need it, take the time to learn some of the libraries out there.

Member Avatar for Slimmy
0
132
Member Avatar for Daigan

[QUOTE=Daigan;1686242]When I used InvalidCharException it says it wasn't found, does that mean that the Ready to Program Java IDE doesn't have that exception?[/QUOTE] You either have to create your own InvalidCharException or just throw a regular Exception. The Exception class is sort of the super-class to all other exceptions, totally …

Member Avatar for Daigan
0
126
Member Avatar for TigerTeck

You've got a couple of errors. 1. When the string is of length 3 you assign a variable "third" a value but this value is never returned. 2. Your if-else statements are wrong @ lines 40-42 (maybe somewhere else too) [CODE] if(input.substring(0,2).equals("10")) first = "Ten of "; else if(input.substring(2,3).equals("D")) third …

Member Avatar for TigerTeck
0
331
Member Avatar for code 117

I would definitely say go ahead. I did a similar project in a CS course a couple of years ago, combining Java and MySQL. There are a number of different libraries for Java when it comes to MySQL, but if you want to keep it simple and not mix in …

Member Avatar for Slimmy
0
514
Member Avatar for newbie14

I dont know that dbconn.commit() returns but if it returns something that can be interpreted as a success or failure, lets say true/false for the sake of argument. Then you could do something like [CODE] if (!dbconn.commit()){ dbconn.rollback(); <- will still be inside try/catch } [/CODE] if not you need …

Member Avatar for newbie14
0
248
Member Avatar for lbgladson

You need to call addPennies() etc. to actually add the money to the piggybank,.

Member Avatar for sirlink99
0
1K
Member Avatar for lbgladson

What do you mean it's not displaying correctly? I guess your output would look something like studentNameAssignmentNameScoreGrade because that is how you call it from line 34. If you would like to tidy it up do something like [CODE] Grader grade1 = new Grader(lastName, assignment, grade, letterGrade); System.out.println("Student: " + …

Member Avatar for Slimmy
0
154
Member Avatar for buba_kazouba

Good luck getting help with that. Describe your problem, post the code related to it and use the code tags.

Member Avatar for Slimmy
0
228
Member Avatar for sarathsshanker

Start by using the CODE tags when posting code and only post the code that is related to your problem, not the whole program. If people need to see more code they will ask for it. No one is going to read through that thing you just posted.

Member Avatar for Slimmy
0
191
Member Avatar for laguardian

I'd suggest a recursive method, something like [CODE] public int sumPower(int n, int m) { return (m > 0) ? (int)Math.pow(n, m) + sumPower(n, m-1) : 1; } [/CODE] Edit: Just saw there was a recursive method proposed already. Oh well, they differ a little bit I guess.

Member Avatar for Slimmy
0
2K
Member Avatar for sirlink99

As stated by a few other posters above I'd go with MySQL as well for this. It is fairly straightforward and you dont have to develop a whole server application that has to be very careful with it's resources (probably reading/writing the highscores to a file). Two clients trying to …

Member Avatar for Ezzaral
0
682
Member Avatar for trivax

[URL="http://java.sun.com/developer/technicalArticles/tools/webapps_1/"]http://java.sun.com/developer/technicalArticles/tools/webapps_1/[/URL] is a good start. When you are done with that follow the links on the bottom of the page. It is a bit of a hassle to get started with, but if I remember correctly there are a few vids on youtube explaining how to write a Hello World …

Member Avatar for Slimmy
0
95
Member Avatar for SMITA6076

[QUOTE=SMITA6076;1526498]So I just need to do the [ICODE]calendar.add( Calendar.DATE, 14 )[/ICODE] before the return statement rather than in it?[/QUOTE] It was just the wrong return type. You tried to return calendar.add(...) which isn't a String. Check [url]http://download.oracle.com/javase/1.5.0/docs/api/java/util/Calendar.html#add(int[/url], int)

Member Avatar for SMITA6076
0
922
Member Avatar for mjavaid

I've not looked through the PDF but under each case X: you simply replace the code in there by a method call i.e [CODE] ... case 1: feetToInch(); break; ... [/CODE] and then you declare your feetToInch() method (note that it has to be static in your case) [CODE]private/protected/public static …

Member Avatar for mjavaid
0
112
Member Avatar for nickcolb

Have you got a specific precision you want to achieve? Otherwise just put it in a for-loop like [CODE] double tSeries = 0.0; for(int i = 3; i < SOME_NBR_TO_ENSURE_PRECISION; i += 2){ if(add){ tSeries += Math.pow(r,i) / factorial(i); } else { tSeries -= Math.pow(r,i) / factorial(i); } }[/CODE] Wont …

Member Avatar for Slimmy
0
1K
Member Avatar for sikelesS

On a side note, you will have some problems with your linearSearch() as it has void as a return type. Change it to int and you'll be fine :)

Member Avatar for Slimmy
0
192
Member Avatar for harinath_2007

Also, don't think there's anything like a "simple java speech recognition program". That kind of software is pretty advanced.

Member Avatar for Slimmy
-1
135
Member Avatar for Taimoor Rana

What do you have to start with? Are you only looking to represent the position of an object in two dimensions? Is time a factor here? Usually to represent what you are describing one uses spherical coordinates, and there are formulas to convert from cartesian (x,y,z) to spherical coordinates. [url]http://en.wikipedia.org/wiki/Cylindrical_coordinates#Spherical_coordinates[/url]

Member Avatar for Slimmy
0
145
Member Avatar for ChieftanBill

Line 25: collection[i] is a MusicAlbum object that you are trying to assign a String (br.readLine() returns a String). You need to convert the String into a MusicAlbum object. Line 77/79: Same thing here. You have temp1 set as a Album[] while collection is a MusicAlbum[]. Also, you might want …

Member Avatar for Slimmy
0
127
Member Avatar for vinithktp
Member Avatar for ~s.o.s~
0
107
Member Avatar for Ralphael
Member Avatar for Viper588

Your eliminateDuplicates method is not even close to solving the problem. You need to compare 2 numbers in the array and if they are the same, you discard one. Create a temporary array that you can fill up with the unique values and then return this array when you are …

Member Avatar for Viper588
0
261
Member Avatar for Ralphael

You're gonna have to have a separate thread to keep track of the seconds. Keep in mind that the sleep(long t) doesn't guarantee to sleep exactly t ms so you're going to have to do some error checking here to remove "drift" efftects.

Member Avatar for Slimmy
0
93
Member Avatar for fabricetoussain

Your constructor is supposed to take two arguments. On line 5 you are not supplying any arguments. Besides that most of your code is also wrong.

Member Avatar for Eric Cute
0
641
Member Avatar for num90
Re: java

You missed the first post in the forum? [url]http://www.daniweb.com/forums/thread99132.html[/url]

Member Avatar for pbl
0
82
Member Avatar for endro

You have an int called payroll (declared on line 12) that you try to invoke methods on.

Member Avatar for endro
0
137
Member Avatar for JellyTurf

You need to change your code a little bit. The Scanner class is very inconsistent when it comes to handling tokens. If you read a line using nextLine() and then read a primitive type such as an integer/double/float/whatever the omitted newline character from the previous call will cause trouble. So …

Member Avatar for ProgrammerAl
0
135
Member Avatar for thalz

If you are new to Java, this project is probably way out of your league if you don't have massive experience in other programming languages and can learn Java really quick. And by the way, why do you need to configure the router to keep track of the remaining time? …

Member Avatar for Slimmy
0
340
Member Avatar for serph09

Looks like school assignments so I wont explicitly tell you the answers, you need to figure it out on your own. 1. In the getMaxX() method you need to iterate over all the Points and compare each x-coordinate. Have a local variable to keep track of the largest x-coordinate and …

Member Avatar for Slimmy
0
111
Member Avatar for Slyvr

You need to initialize the object with the keyword [B]new[/B], like [CODE]Object o = new Object();[/CODE] Or in your case you need to initialize the Inventory object. All declared and not explicitly initialized objects are initialized to null, hence the NullPointerException

Member Avatar for Slyvr
0
106
Member Avatar for Aeonn

You are calling methods on an object inside the other methods that they do not know about. Remove myAtm before each method call and it should work. Note: the notation you are using is for calling methods on an object from "the outside", like in the main method you could …

Member Avatar for Eric Cute
0
2K
Member Avatar for andyhunter

I copy-pasted your code and it works fine for me within the desired ranges. However you do realize that you have to enter a house number twice even if its right the first time? Why not use a regular while loop?

Member Avatar for sincerelibran
-1
117
Member Avatar for chiaig12345

You are never going to get that kind of help here. Post specific parts of your code that doesn't work and describe what you have done so far.

Member Avatar for chiaig12345
0
64
Member Avatar for paniraj s

Cant see anything wrong with that code. Illegal start of expression usually comes up when you try to declare a method inside another method or you have open/close brackets in places they shouldnt be. Check for those things first and get with more code (and use the CODE tags.

Member Avatar for Slimmy
0
111
Member Avatar for cielle

Please... it took me 2 seconds to find it using Google. [url]http://www.jfugue.org/[/url] - you'll find examples and the whole JavaDoc here.

Member Avatar for cielle
0
275
Member Avatar for curbster

You only call chosenItem() once. If you add [CODE]chosenItem(selection, foodTotal);[/CODE] in the end of chooseYourItem() it should work. It's not very nice but if you dont want to work with loops just yet it should do the trick.

Member Avatar for curbster
0
889
Member Avatar for gedas

When you say web services do you mean real web services or are you talking about network programming with Java? Because the way you described what you want to do you could accomplish with network programming.

Member Avatar for gedas
0
108
Member Avatar for shaz24

Depends on which mobile platform you are developing for. But as far as Java goes you could either go with JavaME (Mobile Edition) or Android if that's a possibility for you.

Member Avatar for peter_budo
0
62
Member Avatar for Sal Shah

What have you done so far and what problems have you encountered?

Member Avatar for Sal Shah
0
116
Member Avatar for urlstwohim

First off you are not saving any of the CyberBooks you create in the method addBook(). You need a data structure to keep track of the added books, otherwise the findBookTitle() will be impossible to implement. There is also a few lines of code in there that I dont really …

Member Avatar for urlstwohim
0
4K
Member Avatar for Nickl246

[QUOTE]What ideally would be happening here is that instead of entering 30 at once, once the first value is entered, it would break back to the switch and case, and then the next time that case 1 was entered it would do the same except enter to arrayIn[1] instead of …

Member Avatar for Nickl246
0
281
Member Avatar for Transcendent
Member Avatar for hwalsh

[QUOTE]Is there any chance of making my list prettier, i.e. without the [] around my list?[/QUOTE] Just change the printC() method to print it in the way that you want it. To get access to the Strings in eat you could either use the traditional for-loop like: [CODE] for(int i …

Member Avatar for hwalsh
0
7K
Member Avatar for LianaN

If you are working with File objects the delete() method should work for empty folders. Edit: Missed that you used FTPClient, however the method deleteDirectory() should work on directories as well. Are you catching any exceptions when trying to delete? Have you double checked the path? Edit2: You are calling …

Member Avatar for LianaN
0
838
Member Avatar for pavank75

Im sorry, this is off topic but does anyone else think that the requirements are kind of odd? A university asks the students to solve, a rather large problem, in only the main method. And also, they are not allowed to use arrays but can use hashsets. Why would they …

Member Avatar for jon.kiparsky
0
194
Member Avatar for Vexx

The method itself looks alright, and as you say it works some of the time. How does the code calling send() look? The problem might be in there. Or the problem could even be in the inputstream that handles then sent message.

Member Avatar for Vexx
0
470

The End.