User Profile
Collapse
-
So let me get this straight.. if you make that T[42] you're saying there's NO WAY to resize an array? Also, can anyone maybe give me some live help? I really need to get this done =(... -
-
Well see.. I guess you'd copy them to the new array and then remove them from the first array. How would you do that?
Edit: Remember I need to write a test class, so this has to be in method-form....Leave a comment:
-
The problem is I'm writing a method and the test program has to be able to take the elements OUT of the first array and put them into another.Leave a comment:
-
-
I have two arrays.
And I need to take the elements from array1 and put them at the end of array2. array1 will need to be empty afterwards, so no copying. Ideas? Or is there somewhere I can go to read about it? -
I don't have a question... I need help I don't know java at all. Do they all need to be the same dimension?Leave a comment:
-
-
Help with range method!
First Class------------------
// Car class to define all the methods/classes in CarUser
public class Car {
// Creates object Car
public Car()
{
}
// Let's a car have initial gas in the tank
public Car (double initialGas)
{
gas = initialGas;
}
// method to add gas to the car
public void addGas(double addGas)
{
double newaddGas =... -
[code=java]Excuse the language but I was frustrated lol
public class fag {
public static void main(String[] args)
{
int[] shitface=new int[11];
int input=0;
while (input!=99)
{
input=Console.r eadInt("Enter some shit");
shitface[input]+=1;
}
for (int x=0;x<shitface. length;x++)
{
System.out.prin tln("You entered "+x+" "+shitface[x]+"...Leave a comment:
-
-
I need halp with extra credit--I have a bad grade in my CS class.
The task is: Read integer values from the keyboard until the value 99 is entered. Display an error message if it is not equal to 99. When 99 is entered your program should do the following: Display a count of how many times the values 0-10 were entered. For example the display would look like: "you entered 0 this many times, 1 this many times, 2 this many times" etc. exit the program.
I know you need to use if statements... -
I need to make a program in java that does this with if statement. /*greater than or equal to 10 ifPGM
* Display a "happy Message"
*
* else
* if value less than 10 ;
* display an error message
*/Leave a comment:
-
I don't know what all of this means..
java.lang.NullP ointerException
at sun.misc.Launch er$AppClassLoad er.loadClass(La uncher.java:269 )
at java.lang.Class Loader.loadClas s(ClassLoader.j ava:299)
at java.lang.Class Loader.loadClas s(ClassLoader.j ava:251)
at bluej.runtime.E xecServer$3.run (ExecServer.jav a:787)
All the ints are zero instead of the user entering them and I am really confused, heh. I can't find...Leave a comment:
-
You know? After you posted this every time I create something I think of this post? lol...Leave a comment:
-
I don't know if I did it the long way or whatever but I got it to work.
...Code:import java.io.*; import javax.swing.*; class ArrT { public static void main (String[] args) throws IOException { String inData; int[] anArray; anArray = new int[20]; anArray[0] = 0; anArray[1] = 0;Leave a comment:
-
Heh, my teacher won't re-post the code that he gave us the last day of class before spring break it was something like intarr=newarr[]; or something.. Gah1Leave a comment:
-
Yeah. I can do any number with the fixed code above. I'll see what I can do.
--Edit: Thanks for all the help/replies guys. Helps a lot....Leave a comment:
-
Okay. My professor introduced arrays last class and now I have to use an array to represent 20 values and display the average.Leave a comment:
-
I figured it out.. I was defining the sum/avg before num and num2 could be assigned values by the user. Schweet.
\
import java.io.*;
import javax.swing.*;
class Numbert
{
int num , num2;
{public static void main (String[] args) throws IOException
{ String inData;
inData = JOptionPane.sho wInputDialog (null, "Enter an Integer Value.") ;...Leave a comment:
No activity results to display
Show More
Leave a comment: