Posts
 
Reputation
Joined
Last Seen
Ranked #375
Strength to Increase Rep
+8
Strength to Decrease Rep
-2
83% Quality Score
Upvotes Received
25
Posts with Upvotes
23
Upvoting Members
18
Downvotes Received
6
Posts with Downvotes
5
Downvoting Members
3
9 Commented Posts
~46.3K People Reached
Favorite Tags
Member Avatar for BestJewSinceJC
Member Avatar for Ezzaral
0
5K
Member Avatar for cwpent

Why can't the farm class create a new Chick object with the syntax Chick(true) or Chick(false) depending on if it is young or old? And you can also add a randomizer if you wanted to, and add isYoung() and isOld() methods. And why can't you add that method to the …

Member Avatar for joankim
0
1K
Member Avatar for t@sos

I remember browsing through the API and finding a Robot class and it looked cool so I clicked on it and I was amazed that there was an object that let you control the mouse movement on the screen xD So much crazy stuff to do with the API ^^

Member Avatar for gyno
0
2K
Member Avatar for kvass

Hey everyone! I was recently introduced to Ruby and am trying to learn it by working my way through the Ruby on Rails 3 Tutorial, but I got a little stuck on autotesting. The guide says that for Windows I should install "Growl for Windows," which I did, and then …

0
145
Member Avatar for Alex Edwards

@einjelle: you have your math wrong. The program is right. Multiplication is evaluated prior to addition and subtraction, so 5 + 3 * 8 - 4 becomes 5 + 24 - 4 which is equal to 25, not 17. For the next one, division and multiplication again come before addition, …

Member Avatar for Taywin
1
3K
Member Avatar for lohit kumar

Take a look at the free program Installer Creator -- it lets you set up an install wizard for your program and makes it appear to be exe-ish (an icon shows up in your start menu and on ur desktop etc that you can double click that will link to …

Member Avatar for Progr4mmer
0
169
Member Avatar for kvass

Hey guys! So I recently started exploring the InetAddress object, and came across 2 methods which confused me: [ICODE]getHostName()[/ICODE] and [ICODE]getCanonicalHostName()[/ICODE]. I don't fully understand the difference between a canonical host name (fqdn) and a general host name, so if someone could explain the distinction to me in detail that …

Member Avatar for kvass
0
1K
Member Avatar for js180

Excuse ztini's rudeness, but I think what s/he meant to say was that we aren't going to solve a problem for you u need to show effort and then we can help you out. However, if you are at a loss as to where to turn, you might want to …

Member Avatar for kvass
-1
243
Member Avatar for kvass

Hi all! In a course I am T.A.ing, one of the students submitted this program as their assignment and I did not fully understand why it wasn't working: [CODE=Java] public class Alphabet { public static void main (String[] args) { char alphabet= 'A'; System.out.println("The following is the English alphabet."); while …

Member Avatar for JamesCherrill
0
210
Member Avatar for kvass

Hey guys! So I was wondering -- what's the syntax for updating a JTable that is being displayed on the screen? I know how to allow cells to be edited, but what if I want to like add in entirely new rows while it's being displayed? I tried repaint() and …

Member Avatar for Ezzaral
0
133
Member Avatar for kvass

Hey Everyone! I need some help with a JTable I'm working on. [CODE] TableColumn column = table.getColumnModel().getColumn(2); ... JComboBox comboBox = new JComboBox(); comboBox.addItem("A"); comboBox.addItem("B"); comboBox.addItem("C"); comboBox.addItem("D"); comboBox.addItem("E"); comboBox.addItem("F"); column.setCellEditor(new DefaultCellEditor(comboBox)); [/CODE] I know that the code above will take the column of the table at index 2 and give …

Member Avatar for kvass
0
124
Member Avatar for Ralphael

Can you be a little more specific...? Maybe post some of your code here?

Member Avatar for Slimmy
0
91
Member Avatar for 123a

Actually you can just use the System class' arraycopy method, which is designed specifically for this purpose. Check it out in the java api -- the documentation for the arraycopy method is pretty straightforward but if you have any questions with it don't be afraid to ask :) Iterating over …

Member Avatar for JamesCherrill
0
101
Member Avatar for mangopearapples
Re: Mp3

Jeez guys you could give mango a lil' more help than that. S/he clearly isn't playing mp3 files for a school project or something so it's for personal edification -- just give a lil' more guidance... Personally, I've always wondered how to play mp3 files but I have yet to …

Member Avatar for mangopearapples
0
167
Member Avatar for Lxyslckr

The problem seems to be in your constructor -- it looks like you are missing the code that initializes the instance variables of the class to the variables passed into the constructor.

Member Avatar for haranaboy
0
426
Member Avatar for insanely_sane

Here's a very simple example of recursion to help you get started with understanding it: Problem: Write a program to add all the numbers from 1 to X. Solution: [CODE] public static int addFrom1(int x) { if (x<1) return 0; else if (x==1) return 1; else return x + addFrom1(x-1); …

Member Avatar for insanely_sane
0
153
Member Avatar for bonett09

I have no idea how what e-man suggested will work at all... Here's what I would do: [CODE] print "Enter series of numbers to calculate the average. Enter 0 to end." while exit is false: Prompt user for #. if # is 0, set exit to true. otherwise, add that …

Member Avatar for kvass
0
137
Member Avatar for kvass

Hey guys I'm working on a program that asks the user to enter a month and year and then prints that month's calendar page on the screen. However, to do this I created a daysBetween() method that accepts 2 dates and finds the number of days between them. So basically …

Member Avatar for JamesCherrill
0
80
Member Avatar for PDB1982

First off if the number has already been placed in the array, you want the user to pick a different number. Right now let's say my set is [4,0,0,0,0] after the first time thru and then I want to put in another 4 for the 2nd slot, the computer will …

Member Avatar for kvass
0
90
Member Avatar for PDB1982

On line 7 you set the size to int[4], meaning you are using indexes 0-3. In your loop you try to access index 4, which does not exist. To fix this, change line 7 to: [CODE] int numbers[] = new int[5]; [/CODE]

Member Avatar for kvass
0
152
Member Avatar for MeandJava

XD the problem actually is not in the snippet of code you posted here. You are printing the contents of the Array, namely, the three Punt objects. But it doesn't know how to print a "Punt object" so it is printing the memory address of the objects. If you go …

Member Avatar for JamesCherrill
0
436
Member Avatar for jems5
Member Avatar for mitchneys

[CODE] import java.util.Scanner; //Same as "include" statement //Lets you use a Scanner object to get input. public class Add2 //Creates a new program named "Add2" { //This is what is inside the program. public static void main(String[] args) //Where the code starts (same as "int main()") { //Begins the "main" …

Member Avatar for mitchneys
0
135
Member Avatar for ANDIEniable

[B][U]Arrays[/U][/B] [INDENT]To create an array use the following general syntax: [ICODE]dataType[] arrayName = new dataType[arraySize];[/ICODE] Accessing Size: [ICODE]arr.length[/ICODE] Accessing Data: [ICODE]arr[index][/ICODE] Modifying Data: [ICODE]arr[index] = var[/ICODE] Insertion: Not Applicable Deletion: Not Applicable [/INDENT] [B][U]ArrayLists[/U][/B] [INDENT]To create an ArrayList use the following general syntax: [ICODE]ArrayList<DataType> arrayName = new ArrayList<DataType>();[/ICODE] Accessing Size: …

Member Avatar for kvass
0
419
Member Avatar for islam-morad

Imagine a simple branch structure: [CODE] | / \ | | / \ \ [/CODE] The number of leaves for the top part will be the total number of leaves on the left + the total number of leaves on the right. [INDENT]On the left there is again a branch, …

Member Avatar for islam-morad
0
129
Member Avatar for SoftShock

Ok I'm not going to tell you what to do, but here's what's happening with the code you provided: You start off with p set to 1. p % 2 does equal 1, so the first time thru, p = p * i, where i is 1. p = 1 …

Member Avatar for SoftShock
0
122
Member Avatar for anthwon

Rofl at least he's being rly honest and straightforward about what he's asking for ;) We definitely want to help you out, but we want you to first try it out yourself. If you get stuck, post your issue and code here and we'll help -- but we want to …

Member Avatar for anthwon
0
279
Member Avatar for kchadek

You should work from the highest amount of money down. If the highest form of change is 100s, then first check how many 100s are in the number. Then however many there are, subtract it from the number. i.e. if you have $532 you will end with 5 hundreds, and …

Member Avatar for kvass
0
2K
Member Avatar for PDB1982

[CODE] Loop: >> Read in string from user >> Check length of string >> If length == 5: >> Parse the integer from the string (if you're dealing with integers) >> Exit loop [/CODE] Above is the pseudocode for how I would approach the problem. If you use a loop, …

Member Avatar for tong1
0
109
Member Avatar for intes77

The problem is in this line [ICODE]for(x=0;x<sample.length();x++)[/ICODE]. First of all, in order to access the size of an array, you need to call .length without the () afterward. However, even if you modified the line to read [ICODE]for(x=0;x<sample.length;x++)[/ICODE], your code would still be flawed, because the sample array may be …

Member Avatar for intes77
0
6K