1,678 Posted Topics

Member Avatar for pocku

It doesn't seem like your maxHeapify method has a base case. Meaning, even when it finds the values you are looking for, it will keep looking for those values. You need a base case so that once the method finds what its looking for, it no longer continues calling itself. …

Member Avatar for pocku
0
119
Member Avatar for AcesWild160

In case this is helpful (for what you mentioned above) //By default, can get input typed from the keyboard //This would change if System.in was redirected Scanner keyboard = new Scanner(System.in); //Get input from a file Scanner fileInput = new Scanner(new FileInputStream("yourFile.txt")); Also, following up on what S.o.s said, keep …

Member Avatar for BestJewSinceJC
0
112
Member Avatar for nanna

loop through each index of the array{ loop from 0 to the number at the current index of the array - 1{ print the star } } For the first loop, consider that you want to print the stars for each index of the array. One way to do this …

Member Avatar for nanna
0
1K
Member Avatar for nouryn

So you guys are suggesting reading the entire file into Objects and then editing and writing it back out? Seems inefficient to me - there's no better way? I'm sure there's a way to just have a carat position and then write things there. Not saying your way isn't good, …

Member Avatar for Ezzaral
0
165
Member Avatar for eve.olambo

I will write it for you for one milliiiiiiioon dollars (Austin Powers anyone?)

Member Avatar for stultuske
-2
125
Member Avatar for BestJewSinceJC

I have two programs, one is a GUI and the other is a normal (non GUI) program. How do I make a method in the non-GUI program wait until a JButton on the GUI gets clicked before continuing? (No while loops) This is frustrating since I'm fairly certain somebody here …

Member Avatar for BestJewSinceJC
0
93
Member Avatar for shubhang

Just use google. Type System.out.println() java, or you could also try Java IO. Also, an easy way to 'count' would be // X Thread.getThread().sleep(1000); //waits for 1 second. //If you print out right here, you can be sure that the time is extremely close to 1 second from X

Member Avatar for stultuske
0
259
Member Avatar for l_03

A stack overflow error is caused when you run out of stack space. Stack overflow error [I]can[/I] mean that you have an infinitely recursive method, since this will cause you to run out of space eventually. The stack is just a block of memory that's made available to your program. …

Member Avatar for stultuske
0
776
Member Avatar for sahrourr

What you posted above doesn't really make sense. Make sure to clearly explain what you mean. On one hand, your thread title makes it seem like you are having trouble reading stuff in from the file. If that is the case, then why are you talking about indexOf()? indexOf() is …

Member Avatar for BestJewSinceJC
0
73
Member Avatar for BestJewSinceJC

Hey, one of you guys suggested that I go on Wikipedia's page for hash tables. It was actually pretty informative. I'm pressed for time so I am doing separate chaining for my hash table because it seems like it will be one of the easiest to implement (and according to …

Member Avatar for BestJewSinceJC
0
157
Member Avatar for detoxx
Member Avatar for l_03

float balance = (float) 0.0; Saying (float) is unnecessary here, the compiler knows you are declaring a float. The 'continue' statements are unnecessary, as far as I know, so you should consider that. (It isn't your problem, I don't think) However, one way to limit down your problem is to …

Member Avatar for BestJewSinceJC
0
158
Member Avatar for TaintedPurple

Are you sure you're in the right forum? (I'm not saying you're not - just curious, since I thought this kind of thing was usually php or something)

Member Avatar for BestJewSinceJC
0
62
Member Avatar for Vualta

if (SecondIndex == -1) //call method with null params here else //call method with normal params here So you would just do some calculations to figure out if the index is not a valid index. You could do this anywhere you want - I'd recommend a separate method, it keeps …

Member Avatar for quuba
0
562
Member Avatar for BestJewSinceJC

parseInt does not seem to be throwing an exception when I pass a letter of the alphabet to it. I assume this is because ASCII letters are treated as integers. So my question is, is there a method that will do this: boolean isLetter(); And if not, how do I …

Member Avatar for ~s.o.s~
0
111
Member Avatar for shyka

He's not asking a question, he's asking somebody to do his work for him. Vote- death

Member Avatar for gagansharma
0
258
Member Avatar for DesiFrank

Just so you know, an Object oriented approach to solving the problem would involve creating a class called Bicycle that had instance variables such as wheelRadius and the other things you listed above. Then, you would have methods - for example, one method might calculate the effective radius. In this …

Member Avatar for BestJewSinceJC
0
131
Member Avatar for BestJewSinceJC

I need to build a hash ADT from scratch. This means no use of any java library methods or classes. Does anyone know of any good resources that will explain how hashing works and how this info is helpful to build one? For example, how find() works, how insert() works, …

Member Avatar for BestJewSinceJC
0
90
Member Avatar for harishasan

Seconded on using Sockets. Unless the FTP thing is a requirement of your assignment. Here is where help on using Sockets can be found. [url]http://java.sun.com/docs/books/tutorial/networking/sockets/[/url]

Member Avatar for angelfires
0
133
Member Avatar for coveredinflies

If you are simulating lots of circles bouncing off of each other, you would have to compute whether or not they are currently touching/adjacent by giving each circle a radius, and keeping the current position of the circle's center. Then, as the circle bounced, you could do a calculation between …

Member Avatar for Ezzaral
0
133
Member Avatar for BestJewSinceJC

Is there any way that I can take a String and somehow use it as if its the name of one of my declared Objects? For example, if I have an Animal named germanShephard, is there some way I could say String gerSh = "germanShephard"; and then treat gerSh as …

Member Avatar for ~s.o.s~
0
199
Member Avatar for jonjon1456

[url]http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html[/url] A scanner object is created the same way any other Object is created in Java. If you don't know anything about Objects and how they are created, go read the Java tutorial stickied for this forum.

Member Avatar for stultuske
0
107
Member Avatar for java-clueless

Nobody is going to sift through your code looking for errors. [url]http://java.sun.com/docs/books/tutorial/uiswing/[/url] That tutorial is what helped me gain the skill to write a GUI which handled multiple different activities, including printing, interactivity between itself and other GUIs, updating its information while running (adding text), and updating its main database …

Member Avatar for javaAddict
0
99
Member Avatar for DesiFrank

First, decide what properties a Bank Account has. For example, a Rectangle has the following properties: height, width, area Once you decide what properties a Bank Account has, create variables in your Bank Account class to represent those properties. Then, create methods to do certain things with those properties. Does …

Member Avatar for Ezzaral
0
248
Member Avatar for dampecram

Wait until someone verifies this advice, but back in the day, I did a doubly linked list program. I made the delete function somewhat like you did, and my program didn't work correctly. I think it should be declared as char delete ( ListNodePtr **sPtr, ListNodePtr **tailPtr, char value ) …

Member Avatar for devnar
0
180
Member Avatar for AceAtch

Here is a code example to answer a few of your questions; [CODE] //This creates a 'Scanner' object that is attached to the keyboard (since System.in) is attached, by default, to the keyboard. To learn how to use your Scanner object (I called it input), google 'Java Scanner' and look …

Member Avatar for stultuske
0
159
Member Avatar for adaykin

What do you mean? A queue means its FIFO - first item put in the queue is the first item that comes out of the queue. So its not random.

Member Avatar for adaykin
0
3K
Member Avatar for BITMAN2124

From when I programmed in C, I remember that output stream redirection is done by a.out > filename.txt or a.out < filename.txt I don't remember which. One is input redirection, the other is output. I think the first is output.

Member Avatar for BITMAN2124
0
310
Member Avatar for new_2_java

Get rid of the call to pack(). pack() resizes the components based on the preferred size of each component. So either setPreferredSize() and use pack, or leave your code like it is and do not use pack.

Member Avatar for BestJewSinceJC
0
236
Member Avatar for mrjoli021

When you create a Scanner object, you have to do it with an input stream. The name of the file is [I]not[/I] an input stream. Do this. Scanner input = new Scanner(new FileInputStream(fname));

Member Avatar for BestJewSinceJC
0
255
Member Avatar for zyaday

I don't use drag and drop but if I understand you correctly, you're thinking about it the wrong way. When you click and drag it fires events, and certain methods handle those events. Also, read this, it will answer any basic questions you have [url]http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html[/url]

Member Avatar for BestJewSinceJC
0
91
Member Avatar for BestJewSinceJC

I read about data forwarding and according to my notes, a nop (no-op) is required before a beq operation and after a lw operation. What about sw?

0
61
Member Avatar for frank*

to do so you have to store it in memory. How do you plan to do this without use of a file?

Member Avatar for ArkM
0
102
Member Avatar for c++ prog

Download 1.5 or higher. Honestly, how hard could it be to find a compiler and JVM? Lol

Member Avatar for VernonDozier
0
146
Member Avatar for jackieblock

1. You need to use code tags. Read the rules stickied at the top of the forum. 2. Read this. [url]http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html[/url]

Member Avatar for quuba
0
148
Member Avatar for AceAtch

What they suggested above isn't your problem (well, it is a problem, but its not your error). Your problem is that you can't name your variable with the class name. Circle Circle is invalid because Circle is the class name. The word after the first Circle should be your variable …

Member Avatar for javaAddict
0
180
Member Avatar for Somersett

Why would you add an unnecessary level of abstraction (creating the structures) if you don't need to? The point of a structure is to group related data, not to shove **** together in order to reduce # of parameters

Member Avatar for Somersett
0
291
Member Avatar for tonief

This is just a guess, but I'm somewhat certain that if you don't explicitly call the constructor, the compiler will put in a super() call for you, which calls the default constructor (the constructor with no parameters). Since your Base class does not have a constructor w/ no parameters, that …

Member Avatar for tonief
0
452
Member Avatar for BestJewSinceJC

This is supposed to draw a line through the JButtons when square9 is clicked. It doesn't work but there are no errors and I don't see what the problem is. Ezzaral gave me the code to draw the line earlier. Obviously, the winning squares aren't always diagonal, so I will …

Member Avatar for BestJewSinceJC
0
81
Member Avatar for BestJewSinceJC

I have a TicTacToe board and I need to draw a line through the X's or O's when someone wins. I know how to use the paint method, repaint, etc (as far as how they're called & the basics). I'm just not sure how to go about actually drawing the …

Member Avatar for BestJewSinceJC
0
92
Member Avatar for johnray31

A seg fault occurs because you are attempting to access a memory location that is not part of the memory space that you are supposed to be accessing. In other words, you have an error in your program that is causing it to end up in an unallowed memory location. …

Member Avatar for ArkM
0
127
Member Avatar for llemes4011

Yes. I'm not sure how though. :) You can embed languages, and you can also always store the result then access it later. I'm sure someone else will explain much better.

Member Avatar for llemes4011
0
203
Member Avatar for smakos

I'll help you out, Ezzaral. I voted for the option at the top. I'm still not sure what ugent means, though. *also shrugs*

Member Avatar for bobocqu
0
112
Member Avatar for adetya

Lol, this kid literally posted his entire assignment and [I]expects[/I] someone to do it for him. Wow.

Member Avatar for masijade
0
178
Member Avatar for atman

Identify the portion of the code that isn't working and explain what it is supposed to do and I will gladly try to help you. Also, if we're supposed to identify your problem based on that 100 lines of input & output and that small segment of code, how are …

Member Avatar for bionicseraph
0
151
Member Avatar for sAeNxNyA

Use code tags. Do so by clicking go advanced then clicking the icon at the top. It'll look like this: (And by the way, if you are using a Binary Search Tree, my code may be helpful to you, because at first glance, your code seems to be very wrong. …

Member Avatar for BestJewSinceJC
0
93
Member Avatar for janamrob

Are you asking how to add something to an ArrayList? If so, and your ArrayList is called myList, use myList.add(item); where item is what you want to add to the ArrayList.

Member Avatar for javaAddict
0
170
Member Avatar for phalaris_trip
Member Avatar for complexcodes

[url]http://www.daniweb.com/forums/thread154611-3.html[/url] I spent 2-3 hours helping you, the least you can do is mark the thread as 'solved'. I also gave you a suggestion on how to do this in the other thread, although I don't think my suggestion was a good way to do it. But if you make …

Member Avatar for BestJewSinceJC
0
526
Member Avatar for BestJewSinceJC

I saw someone, I think it was s.o.s, recommend the use of BigDecimal to someone else. So out of curiosity, and having heard of BigDecimal before, I looked at the Javadoc to see how large the values it could hold were and how it held them. From the doc: "Immutable, …

Member Avatar for jbennet
0
165

The End.