Search Results

Showing results 1 to 6 of 6
Search took 0.01 seconds.
Search: Posts Made By: indienick
Forum: Java Dec 10th, 2007
Replies: 2
Views: 2,067
Posted By indienick
I haven't written any I/O Java code in a while, but I do remember using java.io.PrintStream which is a buffered stream, so you don't need to create a whole mess of inline class instances.


import...
Forum: Java Aug 5th, 2007
Replies: 14
Views: 2,311
Posted By indienick
So?

I learned Java just so I knew at least one, non-Smalltalk-based, OOP language.

I'm still making use of other classes within the program (javax.swing.JFrame, javax.swing.JButton, etc.). I...
Forum: Java Aug 5th, 2007
Replies: 14
Views: 2,311
Posted By indienick
What you've got is a good start. Here's how I would do it:

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class GuessGame extends JFrame {

private static JButton...
Forum: Java Aug 5th, 2007
Replies: 14
Views: 2,311
Posted By indienick
Sweet. :)

Alright. I looked over the code you have, and I would do it much differently than you have done it (while still staying within the requirements).


Get rid of the constructor for the...
Forum: Java Aug 4th, 2007
Replies: 14
Views: 2,311
Posted By indienick
That's fine, but having the loop repeatedly call Integer.parseInt() is just going to re-parse the first number it comes across (if they're separated by spaces) or it will just mush all of the...
Forum: Java Aug 4th, 2007
Replies: 14
Views: 2,311
Posted By indienick
One thing I would not do is declare a variable inside of a loop:

...
for (int i = 0; i < 5; i++) {
int n = Integer.parseInt(t.getText());
...
Put this instead:

public void compare(int x)...
Showing results 1 to 6 of 6

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC