1,678 Posted Topics

Member Avatar for selenask

Look at the javadoc for scanner: [url]http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html[/url] where do you see a method called read? None exists. Hence your error.

Member Avatar for selenask
0
94
Member Avatar for jemz
Member Avatar for jemz

Jemz - You can use PrintWriter's print(String) method in order to make sure your text ends up aligned properly. Since all that will be printed is the String that you supply, you can output whatever you want, followed by spaces, other text, whatever, and then when you want to go …

Member Avatar for javaAddict
0
3K
Member Avatar for qadeer37

And as verruckt so kindly pointed out, your response was not necessary because all of the issues had already been cleared up. Your mention of needing the bugs to be listed was unnecessary because the problem was already answered without that information.

Member Avatar for stultuske
0
170
Member Avatar for hket89

[QUOTE=hket89;1117000]But how I gona to make sure every number from 1 to 8 are come out in a pairs?[/QUOTE] You would just use the method randomInt twice to get a pair. If you mean that you wouldn't want a duplicate value in your pair, then you would keep calling it …

Member Avatar for hket89
0
134
Member Avatar for soteri0s

But what problem are you having? You just posted code with no apparent errors or explanation.

Member Avatar for BestJewSinceJC
0
725
Member Avatar for Austinjs0102

[url]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#length%28%29[/url] Read the length() method. Use it.

Member Avatar for BestJewSinceJC
0
84
Member Avatar for beforetheyknew

[QUOTE=beforetheyknew;1116662]Hi guys just wanting some help with exceptions. I understand the try and catch concept but I struggle more with the throw and throws concept, it is my understanding (that may be incorrect), that you a method can be like [CODE]public class thisMethod throws whateverException[/CODE] Am I right in thinking …

Member Avatar for BestJewSinceJC
0
105
Member Avatar for Dave Sinkula

Hi Dave, Your snippets weren't hard for me to find because in 'site search' under 'thread prefixes' there is an option that says 'code snippets'. Combined with entering your username in the username to search for field, it wasn't very hard at all to find your snippets. Also, as an …

Member Avatar for VernonDozier
0
247
Member Avatar for ronghel

The lookup would probably be performed in constant time. Otherwise why bother having a numerical key for your database table? I don't know what algorithm you're talking about though. I'd assume it is, at least conceptually, just an array of some sort. Then when you want to get all the …

Member Avatar for BestJewSinceJC
0
68
Member Avatar for Schecter

[QUOTE=Schecter;1112007][url]http://www.youtube.com/watch?v=cL9Wu2kWwSY[/url] 50 years and a single computer will be more powerful than the entire human population. rad.[/QUOTE] Yet still not capable of any thought beyond what it was programmed to think, which is a severe limitation.

Member Avatar for BestJewSinceJC
2
110
Member Avatar for jhessica

If you follow the daniweb rules pertaining to how to post a question, which are found in a thread at the top of this forum, we'd be glad to help. Basically you need to post as much information as possible (about your problem), show effort in solving the problem on …

Member Avatar for BestJewSinceJC
0
89
Member Avatar for rickywh

[QUOTE=rickywh;1116108]I'm using a socket server that is based off of java and it allows java extensions to be implemented that allow server side login to be performed. I want to create a signup/login system but I'm struggling with finding a way to validate/filter user input before manipulating with the database. …

Member Avatar for BestJewSinceJC
0
170
Member Avatar for doha786

Why do you need a StringSelection Object? You should just need the String, i.e. the one that is stored in your variable called 'selection'. Btw, the error is that you're using PrintWriter's "print" method, and you are passing it a StringSelection Object. But if you look at the class documentation …

Member Avatar for BestJewSinceJC
0
200
Member Avatar for serkan sendur
Member Avatar for kiryoku

You have to keep track of the length of your array and shift the elements all back one, like verruckt said, every time that you 'delete' an element. The true underlying size of the array is not changing.

Member Avatar for BestJewSinceJC
0
220
Member Avatar for nicklbmx

You wouldn't use a while loop to loop over an array [in this case], you would use a for loop, since the size of the array is known in advance. To find the max number make an Integer variable max, write a for loop that loops over the entire array …

Member Avatar for BestJewSinceJC
0
94
Member Avatar for doha786

Combine the path that JFileChooser undoubtedly returns with this: [url]http://forums.sun.com/thread.jspa?threadID=760337[/url] There might be more current solutions available, and in fact I wrote the exact program you're describing myself, but since my program is on my older machine... you're out of luck there.

Member Avatar for peter_budo
0
117
Member Avatar for Namrata.Bibodi
Member Avatar for verruckt24
0
121
Member Avatar for ShaneMcP

Lol - outsourcing to geek squad?? First that is an American company associated with Best Buy, second it doesn't even require a college degree to work there.

Member Avatar for jwenting
0
262
Member Avatar for rwildman23

Post code in code tags. You'll notice the button that says 'code' right above the reply box, it makes it easier for us to help you. And welcome to the forums. :)

Member Avatar for rwildman23
0
148
Member Avatar for Alpdog14

Use division by 100 in combination with the 'int' primitive type to see how many dollars you have. For example, [CODE]int dollars = cents/100;[/CODE] No matter what (int) value you have for cents, at the end of that operation, dollars will be an integer, so it will have the exact …

Member Avatar for BestJewSinceJC
0
11K
Member Avatar for mamameanslove

You only need two variables, one to hold the largest integer and one to hold the smallest integer. Initially, you should set both the large integer and the small integer to the first value read in. For each of the four values afterwards, you should use your if statements to …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for jemz

[url]http://java.sun.com/docs/books/tutorial/uiswing/components/table.html[/url] That contains everything you need to know about a JTable. Read.

Member Avatar for jemz
0
34
Member Avatar for jemz

Print something to your screen? Or send something to the printer? 1. System.out.println() 2. [url]http://java.sun.com/developer/technicalArticles/Printing/SwingPrinting/[/url]

Member Avatar for thomas_naveen
0
120
Member Avatar for mamameanslove

Then you probably don't have the console view (or whatever netbeans calls it) open on netbeans. So it is probably producing the output but not showing it to you. I can tell by looking at your program that it works, but I ran it just in case, and it works …

Member Avatar for BestJewSinceJC
0
121
Member Avatar for kendaop

To force a singleton I suppose you could simply use a getInstance method and refuse to return an instance if one already exists. I *think* you could enforce this by instantiating a private constructor (thus preventing anyone from calling it outside the class). By instantiating a private constructor, you are …

Member Avatar for JamesCherrill
0
155
Member Avatar for Snowdiddy

No, do not use roseindia. There are some good learning materials stickied at the top of this site.

Member Avatar for wee_shark
0
122
Member Avatar for doha786

Look into the File class, it will allow you to create a new File by a given name, I think. And also look into the PrintWriter class which will allow you to output to a text file.

Member Avatar for BestJewSinceJC
0
156
Member Avatar for dubdub

Well the depth is the length of the path from the root of the tree to the node (the number of edges encountered). A binary tree has two children so you can write a simple method that takes a depth (originally passed in as 0) and a Node (the root …

Member Avatar for BestJewSinceJC
0
102
Member Avatar for NPP83

[url]http://java.sun.com/docs/books/tutorial/java/javaOO/objectcreation.html[/url] this is all you will ever need to know about creating objects.

Member Avatar for BestJewSinceJC
0
50
Member Avatar for Assim_

[QUOTE=jbennet;1018156]keyword - *generally*, i guess you get the special treatment[/QUOTE] He's a sponsor. As an admin, it makes sense to give sponsors little things like that.

Member Avatar for happygeek
0
71
Member Avatar for Ghost

Wow. . seriously? Go to the php forum. Start a new thread. This thread was started in 2005.

Member Avatar for JavaHelper
0
2K
Member Avatar for cwarn23

Yeah, you'll find them in a dictionary. Try Merriam Webster. They have a website as well.

Member Avatar for cwarn23
0
160
Member Avatar for Web_Sailor

Use Scanner, not BufferedReader. Create the Scanner then use scanner.nextLine(). Print out the line that nextLine() returns, and you're done. You could use BufferedReader also and just read in bytes while its not = '\n' also, I suppose.

Member Avatar for rAun007
0
8K
Member Avatar for jemz

Nobody is giving you anything except advice (and I find even that doubtful at this point). Read the rules or go away.

Member Avatar for jemz
0
103
Member Avatar for samarudge

[QUOTE=characteredu;1100856]I am using the real version of google [/QUOTE] What's that? Teach us more.

Member Avatar for WaltP
4
189
Member Avatar for mindbender

[QUOTE=Aia;868005]And why not use a [I]flux capacitor[/I]?[/QUOTE] 42. Also, I missed something here, because I was going to answer "You use the malloc function to dynamically allocate the array's memory. ." or something along those lines. Anyone care to clarify?

Member Avatar for Nick Evan
1
5K
Member Avatar for D137Pi

@ poster above me: init doesn't mean alloc. If you're assuming that space has already been set aside for your array (i.e. the array already exists) then simply by updating the appropriate variables (e.g. size, last index, whatever) you can init in constant time. Similarly, for adding, if you keep …

Member Avatar for Rashakil Fol
0
151
Member Avatar for Dani

"i think the most grievous offender is the row of "share this" "send that" "bookmark" "yadda yadda" buttons... I think they're ugly and extremely distracting/annoying. i would get rid of all that, because i never use any of that stuff. i think it would go a long way to cleaning …

Member Avatar for feoperro
3
941
Member Avatar for racshot65

So this is basically... similar to Scrabble? So you need two things: 1. Anagram finder to find every possible anagram 2. Simple search of your dictionary to see which anagram results in the most points. P.S. I'm not a genius on the subject but it seems like you need to …

Member Avatar for BestJewSinceJC
0
77
Member Avatar for happygeek

My girlfriend bought me a small hdtv (for playing video games). Other than that I got a pair of basketball shoes & a ball.

Member Avatar for mitch9654
0
317
Member Avatar for m_sam6

Not saying that these data structures are the most efficient, but one thing you could do is read the entire file into a String (would be inefficient), then search by substring. Continuously increase the size of the substring until it either didn't match the word you're looking for or you …

Member Avatar for AbhikGhosh
0
3K
Member Avatar for mostafanageeb

[url]http://www.csee.umbc.edu/courses/undergraduate/341/fall08/projects/proj5/HuffmanExplanation.html[/url] That article explains the entire process, in detail, and it is the only resource needed to completely implement the huffman coding algorithm. I know because that is from my course website from Fall 2008 when I had to do that project.

Member Avatar for hasanabada
0
110
Member Avatar for sneekula
Member Avatar for gelgin2k
3
593
Member Avatar for largedimples

Grab an algorithms book or tutorial and read a little bit, if you're thinking you're going to get a ready made formula like a 'typical' math formula, you're on the wrong track. You might want to read about asymptotic analysis, runtime analysis, Big O, and connected topics that come up …

Member Avatar for BestJewSinceJC
-1
127
Member Avatar for cwarn23

[QUOTE=vegaseat;1059312]If time has no start and no end, what was before the Big Bang?[/QUOTE] The point of that theory is that people's concept of time is untrue, i.e., there is no such thing as a start or an end. So the theory says that your question is meaningless.

Member Avatar for Dope 7560
0
318
Member Avatar for mimi4IT

It can only do [I]one[/I] operation (not two), addition is only one operation . . the reason it can only do one operation is because once the equal sign is clicked, you only scan through num1 and num2 and take an appropriate operation on those variables. In order to allow …

Member Avatar for mimi4IT
0
141
Member Avatar for emmas4impact

I'm not sure what the android environment is, but if that is referring to the phone which I think it is, then check out Java ME. [url]http://java.sun.com/javame/index.jsp[/url] And then use the phone when testing.

Member Avatar for emmas4impact
0
232
Member Avatar for kizzer

Not that I'm going to help, because I'm not, but the origin of number systems has nothing to do with programming languages, so I don't understand your response, Seten.

Member Avatar for Seten
-1
247

The End.