Thanks bguild, this helped me out a lot, :)

I use to get this error too, but i was using eclipse juno not j2ee, i just had to reinstall eclipse worked for me. Hope it works for you too.

Hey guys I'm having a bit of touble assigning the toString to a string from an index of an array list, any help would be appreciated.

    @Override
    public String indentedToString(int level)
    {
        String answer = " ";
        answer = super.indentedToString(level);
        answer += "Value " + this.list.toString() + "\n";
        for(int i = 0; i < list.size(); i ++)
        {         
            answer += list[i].indentedToString(level + 1);
        }
        return answer;
    }

I keep getting an error in line 9 [array required, but java.util.ArrayList found]
any help ?

Thanks in advance

Hey guys,
I am curious on how to start automated testing, and what kind of software or scripts would i need to test java, c , c ++, c#, or python code. Also does anyone now any good well explained videos or websites out there, i tried searching on google and still no luck, any answers are appreciated :)

thanks in advance.

Hey, well their is three major OS that i know of,
Windows OS most popular
Macintosh
Linux/UNIX
these are all operating systems and they each have distributions of each for example windows has windows 7, vista,xp and so on
mac has max os x, lion, ect
linux has the most which include debian(ubuntu), ferdora and so on
Also mobile computing should not be discretited
ANDROID(linux) and iOS(MAC) are the leading ones but webOS, windowsMobile(windows) and others are out there as well

Hey guys,
I am curious on how to start automated testing, and what kind of software or scripts would i need to test java, c , c ++, c#, or python code. Also does anyone now any good well explained videos or websites out there, i tried searching on google and still no luck, any answers are appreciated :)

thanks in advance.

Hey James, Thanks for replaying

i figured out later on that the cause of this is that the JVM stack size is too small for such a big array so the problem can be taken care by just increasing the stack size not the heap size :)

thanks for the idea though

Hello I am currently working on this code and the code can be runned well from 100-10,000 random elements after that the heap sort says stack over flow, im thinking the recursive calls are the cause of this, so please healp

    public static void MAX_HEAPIFY(int [] A, int i, int n)
    {

        int l = i + 1;//sets the left tree root
        int r = i + 2;//sets the right tree root
        int largest = 0;

        if(l <= n && A[l] > A[i])
        {
            largest = l;
        }
        else
        {
            largest = i;
        }
        if(r <= n && A[r] > A[largest])
        {
            largest = r;
        }
        if(largest != i)
        {
            int temp = A[largest];
            A[largest] = A[i];
            A[i] = temp;
            MAX_HEAPIFY(A, largest, n);
        }
    }
    //this method builds a max heap takes in an array and a int n
    public static void BUILD_MAX_HEAP(int [] A, int n)
    {
        for(int i = (int) Math.floor(n/2); i >= 0; i --)
        {
            //calls the method max_heapify and inputs the Array passed in
            //the i from the for loop
            //and the n passed in as well.
            MAX_HEAPIFY(A, i, n);
        }
    }
    //this method is the heap sort it takes in one array and a lenght 
    public static void HEAPSORT(int [] A, int n)
    {
        BUILD_MAX_HEAP(A, n);
        for(int i = n; i >= 1; i --)
        {
            //exchanges the elements of the arrays.
            int temp = A[0];
            A[0] = A[i];
            A[i] = temp;
            MAX_HEAPIFY(A, 0, i-1);

        }

    }

and here is the error

Exception in ...

well i have solve from this
true
Tomatoes
Lettuce
Milk
Hello
ipad
Hello
windows
soap

ipad
Hello
windows
soap

ipad
Hello
windows
soap

ipad
Hello
windows
soap

null
null
null
null
null
............

to this

true
Tomatoes
Lettuce
Milk
Hello
ipad
Hello
windows
soap

null
null
null
null
null
............

so i have discovered why the bag 2 was printing twice :)

it was the smallest thing in the union method

[CODE]
for(Object objects1 = baggie2.getFirst(); objects !=null; objects1 = baggie2.getFirst()){
//if baggie1 and baggie2 have same then is found is true
if(objects.equals(objects1)){
isFound = true;
break;

[/CODE]

the problem was the if statmemnt it had
[CODE]if(objects.equals(baggie2)[/CODE]

and i needed
[CODE]if(objects.equals(objects1)[/CODE]

So i have been assigned a program where i create a interface a bag and the main or tester i have been trying to get this done for a while now and so far two other people have checked my work and have no idea why my list prints the null something like this

[B]:These is the output i get after running the code:[/B]
true
Tomatoes
Lettuce
Milk
Hello
ipad
Hello
windows
soap

ipad
Hello
windows
soap

ipad
Hello
windows
soap

ipad
Hello
windows
soap

null
null
null
null
null
............

This eventually stops and wont let the rest of the program to continue. :( I know that the problem is with the method union.

So here is my interface this should be working fine :)
[CODE]public interface Bag {

public void add(Object object);//adds an object 
public boolean contains(Object object);//checks if contains certain object
public Object getFirst();//gets first object
public Object getNext();//gets next object
public boolean remove(Object object);//removes an object
public int size();//gets size 

[/CODE]

Here is my New_Bag that implements Bag interface

[CODE]
public class New_Bag implements Bag{
private Object [] objects;
private int nextIndex = 0;

//public New_Bag(){}
public New_Bag(int maxObject){
    objects = new Object[maxObject];
}
public New_Bag() {
    objects = new Object[100];
}

@Override
public void add(Object object) {
    for(int index = 0; index < objects.length; index++){
         if (objects[index] == null){
             objects[index] = object;
             break;
         }
    }
}
@Override
//checks if the bag contains a given object 
public boolean contains(Object object) {
    for (int index = 0; ...

Yes i know a website where a guy named bucky does a lot of programming tutorials and python included this is the website to python tutorials
[url]http://www.thenewboston.com/?cat=40&pOpen=tutorial[/url]

Wow thank you guys i will use both your methods and see withone works the best =]. Thank you again for the help

happy Coding

Hmm well i have to agree with Taywin since java is in a "virtual machine" meaning that the Operating system is in the lowest level, and the virtual machine also gives you certain amount of ram unlike C , like if you create a recursive program it will eventually run out of ram and quit without completing quitting your computer. As a full OS like MAC or Windows or Linux but you might be able to create a "webOS" .

Hey all =] , I am having a few problems ending this coding homework and i would love if you could help me on how to solve this problem, well my problem is that i try to print the toStirng in my constructor class and for the months it prints the number rather than the name for example i input month, day, year and i input 04 , 30, 1992. I would like it to print April 4, 1992 But it prints 04, 30, 1992 so how do i make it print the month

Run Test Results:
what year is it?
1992
what month number is it?
04
what day of the month is it?
30
The date you have enterd is : 4, 30, 1992

and my code is

[B]MAIN[/B]
[CODE]
import java.util.*;

public class DateTest {

public static void main(String[] args) {
    Scanner reader = new Scanner(System.in);

    System.out.println ("what year is it?");
    int year = reader.nextInt();
    System.out.println ("what month number is it?");
    int month = reader.nextInt();
    System.out.println ("what day of the month is it?");
    int day = reader.nextInt();

    Date date = new Date (month, day, year);

    System.out.println(date.toString());
}

}
[/CODE]
[B]Constructor class[/B]
[CODE]public class Date {

private int day;
private int month;
private int year;
public Date(int monthIn, int dayIn, int yearIn ){
    day = dayIn;
    month = monthIn;
    year = yearIn;
    //end of constructor
}
//getters
public int getDay(){
    return day;
}
public int getMonth(){
    return month;
}
public int getYear(){
    return year;
}
//setters
public void ...

yes , i know and i appreciate you for taking time and looking at my pityful coding, but this is a single class of my 3 class project one containing the main method and the other two been constructors this one holdiing the array and the other class should use for each index in the array :)

i know its not your job to do this for me, and ohh did you read the description above, is a class that should not have a main, :) just letting you know in case my description was confusing

So, i have to methods in a non main class and i need to figure out how to print both the println in a chart with two columns
should look something like this

x : y
x : y
x : y
x : y
x : y

but instead i print like this
x
x
x
x
x
y
y
y
y
y

this is my code , any help would be appreciated

[CODE]/*

  • To change this template, choose Tools | Templates
  • and open the template in the editor.
    */

/*

  • @author vazquez
    */
    import java.util.Date;
    import java.util.Calendar;
    import java.text.DateFormat;
    import java.text.NumberFormat;

public class RetiermentCalculator
{
AccountInformation[] years = new AccountInformation[35];
public RetiermentCalculator(int aYear, double aBeginIncome, double aContribution, double aReturn )
{
double answer = 0.0;
double finance = (aBeginIncome + aContribution);
double intrestMade = finance * aReturn;
for (int index = 0; index < years.length; index ++)
{
answer += finance + intrestMade;
NumberFormat nf = NumberFormat.getCurrencyInstance();
System.out.println(nf.format(answer));
}

}
@Override
public String toString()//@override
{
    String answer = "";
    Calendar greg = Calendar.getInstance();
    greg.set( 2010, Calendar.DECEMBER, 31);
    DateFormat formatter = DateFormat.getDateInstance();
    for(int index = 0 ; index < years.length ; index ++)
    {
        greg.add(Calendar.YEAR, 1);
        Date gregsTime = greg.getTime();
        System.out.println(formatter.format(greg.getTime()));
    }
    return(answer);
}

}
[/CODE]

so i am working on a assigment for school, and i need help with the java.util.Calendar , i am trying to increment the year of as today by one each index of an array . This functions needs to be inside a toString(). so i need some help i know i need a for loop to pass the add(calendar.YEAR, index)
here is what i have so far ..ohh yeah this class should not have a main method.

[CODE]
import java.util.Date;
import java.util.Calendar;
import java.text.DateFormat;
import java.text.NumberFormat;

public class RetiermentCalculator
{
AccountInformation[] years = new AccountInformation[35];
public RetiermentCalculator(int aYear, double aBeginIncome, double aContribution, double aReturn )
{
double answer = 0.0;
double finance = (aBeginIncome + aContribution);
double intrestMade = finance * aReturn;
for (int index = 0; index < years.length; index ++)
{
answer += finance + intrestMade;
System.out.println(answer);
}
}
@Override
public String toString()//@override
{
String answer = "";
Calendar greg = Calendar.getInstance();
Date sometime = greg.getTime();
DateFormat formatter = DateFormat.getDateInstance();
for(int index = 0 ; index < years.length; index ++)
{
greg.add(greg.YEAR, index);
answer = formatter.format(sometime);
}
return(answer);
}
}
[/CODE]

So, you have XP, and wish to dual boot. Well Ubuntu and some of its distros have the option to download a windows executable "wubi.exe" [URL="

Hi, the way i understand; you have a computer somewhere that is not connected to the internet, then you want something to just give you all the packages for you to download then install them on the machine with no internet connection. Well maybe not like Ubuntu Software center online look alike but their is this software

[URL="