Calling a method

  • Follow


Hi can some one tell me why I can call union and not intersection.

These are the error message "intersection(boolean) in IntergerSet
cannot be applied to (boolean[])"
where the arrow is.

Here is my code:
//in main
{
          set.union(arraySetB);
--->     set.intersection(arraySetC);
}

//in anther class
public void union(boolean other[])
{
    boolean res[] = new boolean [SIZE];

    for(int i=0; i<SIZE; i++)
    	if(arraySet[i]==true||other[i]==true)
    		res[i] = true;
    		arraySet = res;
}

public void intersection(boolean other[])
{
     boolean res[] = new boolean [SIZE];

     for(int i=0; i<SIZE; i++)
     	if(arraySet[i]==true&&other[i]==true)
    		res[i] = true;
    		arraySet = res;
}


Thanks

0
Reply sdlt85 (56) 10/20/2007 1:58:13 AM

sdlt85@gmail.com wrote:
> Hi can some one tell me why I can call union and not intersection.
> 
> These are the error message "intersection(boolean) in IntergerSet
> cannot be applied to (boolean[])"
> where the arrow is.
> 
> Here is my code:
> //in main
> {
>           set.union(arraySetB);
> --->     set.intersection(arraySetC);
> }
> 
> //in anther class
> public void union(boolean other[])
> {
>     boolean res[] = new boolean [SIZE];
> 
>     for(int i=0; i<SIZE; i++)
>     	if(arraySet[i]==true||other[i]==true)
>     		res[i] = true;
>     		arraySet = res;
> }
> 
> public void intersection(boolean other[])
> {
>      boolean res[] = new boolean [SIZE];
> 
>      for(int i=0; i<SIZE; i++)
>      	if(arraySet[i]==true&&other[i]==true)
>     		res[i] = true;
>     		arraySet = res;
> }

SSCCE.
<http://www.physci.org/codes/sscce.html>

-- 
Lew
0
Reply Lew 10/20/2007 2:14:58 AM


sdlt85@gmail.com wrote:
> Hi can some one tell me why I can call union and not intersection.
> 
> These are the error message "intersection(boolean) in IntergerSet
> cannot be applied to (boolean[])"
> where the arrow is.
....
> --->     set.intersection(arraySetC);


Although it would have been helpful to include the arraySetC
declaration, the message makes it clear that arraySetC is a boolean, not
an array of boolean, and intersection requires a boolean array.

Patricia
0
Reply Patricia 10/20/2007 2:19:54 AM

> Although it would have been helpful to include the arraySetC
> declaration, the message makes it clear that arraySetC is a boolean, not
> an array of boolean, and intersection requires a boolean array.
>
> Patricia

It is a boolean array
I declared like this:
         boolean arraySetA[] = new boolean[101];
    	boolean arraySetB[] = new boolean[101];
    	boolean arraySetC[] = new boolean[101];
    	{
       		final int[] init = {6, 7, 9, 50, 69, 86};
       		for (int i = 0; i < init.length; ++i)
          		arraySetC[init[i]] = true;
    	}
       	boolean arraySetD[] = new boolean[101];
    	{
       		final int[] init = {7, 9, 13, 14, 15, 19, 37, 50, 72, 74};
       		for (int i = 0; i < init.length; ++i)
          		arraySetD[init[i]] = true;
    	}

0
Reply sdlt85 10/20/2007 2:29:26 AM

sdlt85@gmail.com wrote:
> It is a boolean array
> I declared like this:
>          boolean arraySetA[] = new boolean[101];
>     	boolean arraySetB[] = new boolean[101];
>     	boolean arraySetC[] = new boolean[101];
>     	{
>        		final int[] init = {6, 7, 9, 50, 69, 86};
>        		for (int i = 0; i < init.length; ++i)
>           		arraySetC[init[i]] = true;
>     	}
>        	boolean arraySetD[] = new boolean[101];
>     	{
>        		final int[] init = {7, 9, 13, 14, 15, 19, 37, 50, 72, 74};
>        		for (int i = 0; i < init.length; ++i)
>           		arraySetD[init[i]] = true;
>     	}
> 

SSCCE.
<http://www.physci.org/codes/sscce.html>

-- 
Lew
0
Reply Lew 10/20/2007 2:35:09 AM

sdlt85@gmail.com wrote:
>> Although it would have been helpful to include the arraySetC
>> declaration, the message makes it clear that arraySetC is a boolean, not
>> an array of boolean, and intersection requires a boolean array.
>>
>> Patricia
> 
> It is a boolean array
....

In that case, you need to follow Lew's advice and post an SSCCE
<http://www.physci.org/codes/sscce.html>

Patricia
0
Reply Patricia 10/20/2007 2:39:10 AM

OK

0
Reply sdlt85 10/20/2007 2:50:41 AM

On Fri, 19 Oct 2007 18:58:13 -0700, sdlt85@gmail.com wrote, quoted or
indirectly quoted someone who said :

>Here is my code:
>//in main
Lew has asked you several times you post your code.  If you don't post
complete code, 99% of the time the problem is in the part you did not
post.  The problem is nearly always that you are looking in the wrong
place for the problem, otherwise you would likely have already solved
it yourself.

Further it is MUCH easier to find problems with the help of a compiler
and run time that trying to find them by eye. With complete code,
people trying to help can add debugging statements.
-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
0
Reply Roedy 10/20/2007 5:16:56 AM

sdlt85@gmail.com wrote, quoted or indirectly quoted someone who said :
>> Here is my code:
>> //in main

Roedy Green wrote:
> Lew has asked you several times you post your code. 

Actually, twice, and Patricia asked twice, now you've asked and I'm repeating 
it.  Amongst us it comes to several times.

> If you don't post complete code, 99% of the time the problem is in the part you did not
> post.  The problem is nearly always that you are looking in the wrong
> place for the problem, otherwise you would likely have already solved
> it yourself.
> 
> Further it is MUCH easier to find problems with the help of a compiler
> and run time that trying to find them by eye. With complete code,
> people trying to help can add debugging statements.

-- 
Lew
0
Reply Lew 10/20/2007 12:59:11 PM

Sorry, I was having problems with my internet, but here is my code:

import java.util.Scanner;

public class IntergerSet
{
	private static final int SIZE = 101;
    private boolean[] arraySet = new boolean[SIZE];

	// No-arguments on the array.
	public IntergerSet()
	{
		for(int i=0; i<SIZE; i++)
		{
			arraySet[i] = false;
		}
	}

	//overloading constructor
	public IntergerSet(int j)
    {
     	if(validEntry(j))
     		insert(j);
    }

	//check valid entry not over 100.
	private boolean validEntry(int k)
	{
		return k>=0 && k<=SIZE;
	}

    //Getting input from the user.
    public void inputSet ()
	{
		Scanner input = new Scanner (System.in);

    	int value;
    	boolean arraySet[] = new boolean[100];
    	do
    	{
    		System.out.println("\nPlease enter a value or -1 to finish: ");
    		value = input.nextInt();
    		if(validEntry(value))
		    	arraySet[value] = true;
		    else
		    	System.out.println("\nInvalid value");
    	}while(value != -1);
    }

    //Finding the union of two sets
    public void union(boolean other[])
    {
    	boolean res[] = new boolean [SIZE];

    	for(int i=0; i<SIZE; i++)
    		if(arraySet[i]==true||other[i]==true)
    			res[i] = true;
    			arraySet = res;
	}

   //Finding the intersection of two sets
	public void intersection(boolean other[])
	{
   		boolean res[] = new boolean [SIZE];

        for(int i=0; i<SIZE; i++)
        	if(arraySet[i]==true&&other[i]==true)
    			res[i] = true;
        		arraySet = res;
	}

	//Inserting a value to the set
	public void insert(int other)
	{
		if(validEntry(other))
		{
			System.out.printf("\nYou add %d ", other);
			arraySet[other]=true;
		}
		else
			System.out.print("\nInvalid insert attempted\n");
	}

    //Deleting a value from the set
	public void delete(int other)
	{
		if(validEntry(other))
		{
			System.out.printf("\nYou delete %d ", other);
			arraySet[other]=false;
		}
		else
			System.out.print("\nInvalid delete attempted\n");
	}

    //Prints the sets in a string.
	public String toSetString()
	{
		String setString = "{ ";
		boolean empty = true;

		for(int s=0; s<SIZE; s++)
		{
			if(arraySet[s])
			{
				setString = setString + s + " ";
				empty = false;
			}
		}
		if(empty)
			setString = "---";
		setString = setString + " }";
		return setString;
	}

	//Checks if the sets are equal
	public void isEqualTo(boolean other[])
	{
		for(int t=0; t<SIZE; t++)
			if(arraySet[t] != other[t])
			return false;
		return true;
	}
}


import java.util.Scanner;
public class IntegerSetTest
{
    public static void main(String args[])
    {
       	Scanner input = new Scanner(System.in);

       	boolean arraySetA[] = new boolean[101];
    	boolean arraySetB[] = new boolean[101];
    	boolean arraySetC[] = new boolean[101];
    	{
       		final int[] init = {6, 7, 9, 50, 69, 86};
       		for (int i = 0; i < init.length; ++i)
          		arraySetC[init[i]] = true;
    	}
       	boolean arraySetD[] = new boolean[101];
    	{
       		final int[] init = {7, 9, 13, 14, 15, 19, 37, 50, 72, 74};
       		for (int i = 0; i < init.length; ++i)
          		arraySetD[init[i]] = true;
    	}

       	int i, j;

       	for(i=0; i<101; i++)
       	{
       		j=i*2;
       		arraySetA[j] = true;
       	}

       	for(i=1; i<101; i=i+2)
       	{
       		arraySetA[i] = true;
       	}

       	System.out.println("Welcome to the Integer Set\n");

    	System.out.println("This program is going to find the union or "
+
    		"intersection of any two sets you enter.\nAlso it will delete "
+
    		"or insert an element and check if the sets are equal.");

        IntergerSet set = new IntergerSet();
        set.inputSet();

        System.out.println("\n\nIf you want to add a value to the set
press 'a': ");
        String adding = input.next();
        if("a".equalsIgnoreCase(adding))
		{
			System.out.printf("You are going to add a value to the set\n");
			System.out.print("\nEnter the value to be added: ");
        	int addValue = input.nextInt();
        	set.insert(addValue);
		}

        System.out.println("\n\nIf you want to delete a value from the
set press 'd': ");
        String deleting = input.next();
        if("d".equalsIgnoreCase(deleting))
		{
			System.out.printf("\nYou are going to delete a value from the set
\n");
			System.out.print("\nEnter the value to be deleted: ");
        	int deleteValue = input.nextInt();
        	set.delete(deleteValue);
		}

		System.out.print("Enter 'u' to find the union\nEnter 'i' to find the
intersection\n" +
			"Enter 'c' to compare the sets\nIf not enter 'n'");
		String option = input.next();
		if("u".equalsIgnoreCase(option))
		{
			set.union(arraySetB);
		}

		if("i".equalsIgnoreCase(option))
		{
			set.intersection(arraySetA);
		}

		if("c".equalsIgnoreCase(option))
		{
			set.isEqualTo(arraySetC);
		}
		else if("n".equalsIgnoreCase(option))
		{
			System.out.println("Thanks for using my program\n");
		}

		set.toSetString();
    }
}

Thanks

0
Reply sdlt85 10/20/2007 11:43:44 PM

Sorry boolean arraySetB is
for(i=1; i<101; i=i+2)
{
	arraySetB[i] = true;
}

NOT:
    
for(i=1; i<101; i=i+2)
{
      arraySetA[i] = true;
}

        

0
Reply sdlt85 10/20/2007 11:52:11 PM

Well here is my code again:


import java.util.Scanner;

public class IntergerSet
{
	private static final int SIZE = 101;
    private boolean[] arraySet = new boolean[SIZE];

	// No-arguments on the array.
	public IntergerSet()
	{
		for(int i=0; i<SIZE; i++)
		{
			arraySet[i] = false;
		}
	}

	//overloading constructor
	public IntergerSet(int j)
         {
     	if(validEntry(j))
     		insert(j);
         }

	//check valid entry not over 100.
	private boolean validEntry(int k)
	{
		return k>=0 && k<=SIZE;
	}

    //Getting input from the user.
    public void inputSet ()
    {
		Scanner input = new Scanner (System.in);

    	int value;
    	boolean arraySet[] = new boolean[100];
    	do
    	{
    		System.out.println("\nPlease enter a value or -1 to finish: ");
    		value = input.nextInt();
    		if(validEntry(value))
		    	arraySet[value] = true;
		    else
		    	System.out.println("\nInvalid value");
    	}while(value != -1);
    }

    //Finding the union of two sets
    public void union(boolean other[])
    {
    	boolean res[] = new boolean [SIZE];

    	for(int i=0; i<SIZE; i++)
    		if(arraySet[i]==true||other[i]==true)
    			res[i] = true;
    			arraySet = res;
    }

   //Finding the intersection of two sets
	public void intersection(boolean other[])
	{
   		boolean res[] = new boolean [SIZE];

         for(int i=0; i<SIZE; i++)
        	if(arraySet[i]==true&&other[i]==true)
    			res[i] = true;
        		arraySet = res;
	}

	//Inserting a value to the set
	public void insert(int other)
	{
		if(validEntry(other))
		{
			System.out.printf("\nYou add %d ", other);
			arraySet[other]=true;
		}
		else
			System.out.print("\nInvalid insert attempted\n");
	}

    //Deleting a value from the set
	public void delete(int other)
	{
		if(validEntry(other))
		{
			System.out.printf("\nYou delete %d ", other);
			arraySet[other]=false;
		}
		else
			System.out.print("\nInvalid delete attempted\n");
	}

    //Prints the sets in a string.
	public String toSetString()
	{
		String setString = "{ ";
		boolean empty = true;

		for(int s=0; s<SIZE; s++)
		{
			if(arraySet[s])
			{
				setString = setString + s + " ";
				empty = false;
			}
		}
		if(empty)
			setString = "---";
		setString = setString + " }";
		return setString;
	}

	//Checks if the sets are equal
	public void isEqualTo(boolean other[])
	{
		for(int t=0; t<SIZE; t++)
			if(arraySet[t] != other[t])
			return false;
		return true;
	}
}



import java.util.Scanner;
public class IntegerSetTest
{
    public static void main(String args[])
    {
       	Scanner input = new Scanner(System.in);

       	boolean arraySetA[] = new boolean[101];
    	boolean arraySetB[] = new boolean[101];
    	boolean arraySetC[] = new boolean[101];
    	{
       		final int[] init = {6, 7, 9, 50, 69, 86};
       		for (int i = 0; i < init.length; ++i)
          		arraySetC[init[i]] = true;
    	}
       	boolean arraySetD[] = new boolean[101];
    	{
       		final int[] init = {7, 9, 13, 14, 15, 19, 37, 50, 72, 74};
       		for (int i = 0; i < init.length; ++i)
          		arraySetD[init[i]] = true;
    	}

       	int i, j;

       	for(i=0; i<101; i++)
       	{
       		j=i*2;
       		arraySetA[j] = true;
       	}

       	for(i=1; i<101; i=i+2)
       	{
       		arraySetB[i] = true;
       	}

       	System.out.println("Welcome to the Integer Set\n");

    	System.out.println("This program is going to find the union or "
+
    		"intersection of any two sets you enter.\nAlso it will delete "
+
    		"or insert an element and check if the sets are equal.");

        IntergerSet set = new IntergerSet();
        set.inputSet();

        System.out.println("\n\nIf you want to add a value to the set
press 'a': ");
        String adding = input.next();
        if("a".equalsIgnoreCase(adding))
	{
		System.out.printf("You are going to add a value to the set\n");
		System.out.print("\nEnter the value to be added: ");
        	           int addValue = input.nextInt();
        	           set.insert(addValue);
	}

        System.out.println("\n\nIf you want to delete a value from the
set press 'd': ");
        String deleting = input.next();
        if("d".equalsIgnoreCase(deleting))
	{
		System.out.printf("\nYou are going to delete a value from the set
\n");
		System.out.print("\nEnter the value to be deleted: ");
        	         int deleteValue = input.nextInt();
        	         set.delete(deleteValue);
	}

	System.out.print("Enter 'u' to find the union\nEnter 'i' to find the
intersection\n" +
		"Enter 'c' to compare the sets\nIf not enter 'n'");
	String option = input.next();
	if("u".equalsIgnoreCase(option))
	{
		set.union(arraySetB);
	}

	if("i".equalsIgnoreCase(option))
	{
		set.intersection(arraySetA);
	}

	if("c".equalsIgnoreCase(option))
	{
		set.isEqualTo(arraySetC);
	}
	else if("n".equalsIgnoreCase(option))
	{
		System.out.println("Thanks for using my program\n");
	}

	set.toSetString();
    }
}

This is fine

0
Reply sdlt85 10/20/2007 11:55:46 PM

sdlt85@gmail.com wrote:
> Well here is my code again:

No TABs in Usenet posts, please.

> import java.util.Scanner;
> 
> public class IntergerSet

People have pointed out at least twice that you should change the spelling of 
this class.

> {
>   private  static  final  int  SIZE  =  101;
>   private  boolean[]  arraySet  =  new  boolean[SIZE];
>  
>   //  No-arguments  on  the  array.
>   public  IntergerSet()
>   {
>      for(int  i=0;  i<SIZE;  i++)
>      {
>        arraySet[i]  =  false;
>      }

This is a completely superfluous initialization, since all these array 
elements are already false.  BTW, we remind you that "arraySet" is not a good 
variable name in real-world code.

>   }
>  
>   //overloading  constructor
>   public  IntergerSet(int  j)
>   {
>      if(validEntry(j))

braces

>         insert(j);
>    }
>  
>   //check  valid  entry  not  over  100.
>   private  boolean  validEntry(int  k)
>   {
>      return  k>=0  &&  k<=SIZE;
>   }
>  
>   //Getting  input  from  the  user.
>   public  void  inputSet  ()
>   {
>     Scanner  input  =  new  Scanner  (System.in);
>  
>     int  value;
>     boolean  arraySet[]  =  new  boolean[100];

This declaration of arraySet will shadow the instance variable.  They're also 
different sizes.  One or the other must go.

>     do
>     {
>       System.out.println("\nPlease  enter  a  value  or  -1  to  finish:  ");
>       value  =  input.nextInt();
>       if(validEntry(value))
>         arraySet[value]  =  true;

braces
This statement will throw an exception if value == SIZE.

>       else
>         System.out.println("\nInvalid  value");

This will indicate -1 as an invalid value right after having told the user 
that it's a valid value.

>     }while(value  !=  -1);

And now you throw away 'arraySet'.  And after all that work building it, too.

>   }
>  
>   //Finding  the  union  of  two  sets
>   public  void  union(boolean  other[])
>   {
>     boolean  res[]  =  new  boolean  [SIZE];
>  
>     for(int  i=0;  i<SIZE;  i++)

braces

>       if(arraySet[i]==true||other[i]==true)

braces
What happens if other.length < SIZE?

>         res[i]  =  true;
>     arraySet  =  res;

Or you could've modified arraySet in place and saved making the copy.

>   }
>  
>   //Finding  the  intersection  of  two  sets
>   public  void  intersection(boolean  other[])
>   {
>     boolean  res[]  =  new  boolean  [SIZE];
>  
>     for(int  i=0;  i<SIZE;  i++)
>     if(arraySet[i]==true&&other[i]==true)

braces
'==true' is completely superfluous.  If it's true, of course it == true.  Why 
would you check if true == true?

>       res[i]  =  true;
>     arraySet  =  res;
>   }
>  
>   //Inserting  a  value  to  the  set
>   public  void  insert(int  other)
>   {
>     if(validEntry(other))
>     {
>       System.out.printf("\nYou  add  %d  ",  other);
>       arraySet[other]=true;
>     }
>     else

braces

>       System.out.print("\nInvalid  insert  attempted\n");
>    }
>  
>   //Deleting  a  value  from  the  set
>   public  void  delete(int  other)
>   {
>     if(validEntry(other))
>     {
>       System.out.printf("\nYou  delete  %d  ",  other);
>       arraySet[other]=false;
>     }
>     else
>       System.out.print("\nInvalid  delete  attempted\n");
>   }
>  
>   //Prints  the  sets  in  a  string.
>   public  String  toSetString()
>   {
>     String  setString  =  "{  ";
>     boolean  empty  =  true;
>  
>     for(int  s=0;  s<SIZE;  s++)
>     {
>       if(arraySet[s])
>       {
>         setString  =  setString  +  s  +  "  ";
>         empty  =  false;
>       }
>     }
>     if(empty)

braces

>       setString  =  "---";
>     setString  =  setString  +  "  }";
>     return  setString;
>   }
>  
>   //Checks  if  the  sets  are  equal
>   public  void  isEqualTo(boolean  other[])
>   {
>     for(int  t=0;  t<SIZE;  t++)

braces

>       if(arraySet[t]  !=  other[t])

braces

>         return  false;
>       return  true;

Uh-oh - you can't return values from a void method.

>     }
>   }

>  import  java.util.Scanner;
>  public  class  IntegerSetTest
>  {
>   public  static  void  main(String  args[])
>   {
>     Scanner  input  =  new  Scanner(System.in);
>  
>     boolean  arraySetA[]  =  new  boolean[101];
>     boolean  arraySetB[]  =  new  boolean[101];
>     boolean  arraySetC[]  =  new  boolean[101];
>     {
>       final  int[]  init  =  {6,  7,  9,  50,  69,  86};
>       for  (int  i  =  0;  i  <  init.length;  ++i)
>         arraySetC[init[i]]  =  true;
>     }
>     boolean  arraySetD[]  =  new  boolean[101];
>     {
>       final  int[]  init  =  {7,  9,  13,  14,  15,  19,  37,  50,  72,  74};
>       for  (int  i  =  0;  i  <  init.length;  ++i)
>         arraySetD[init[i]]  =  true;
>     }

When you see logic repeated like this, it indicates an opportunity to refactor 
the common logic into a method.

>     int  i,  j;

You should declare i inside the for loop initialization statement, and j in 
the loop body.  Scratch that, you don't need j at all.

>     for(i=0;  i<101;  i++)
>     {
>       j=i*2;
>       arraySetA[j]  =  true;
>     }
>  
>     for(i=1;  i<101;  i=i+2)
>     {
>       arraySetB[i]  =  true;
>     }
>  
>     System.out.println("Welcome  to  the  Integer  Set\n");
>  
>     System.out.println("This  program  is  going  to  find  the  union  or  "
>     +"intersection  of  any  two  sets  you  enter.\nAlso  it  will  delete  "
>     +"or  insert  an  element  and  check  if  the  sets  are  equal.");
>  
>     IntergerSet  set  =  new  IntergerSet();
>     set.inputSet();

This method call has no net effect.

>     System.out.println(
> "\n\nIf  you  want  to  add  a  value  to  the  set press  'a':  ");
>     String  adding  =  input.next();
>     if("a".equalsIgnoreCase(adding))
>     {
>       System.out.printf("You  are  going  to  add  a  value  to  the  set\n");
>       System.out.print("\nEnter  the  value  to  be  added:  ");
>       int  addValue  =  input.nextInt();
>       set.insert(addValue);
>     }
>  
>     System.out.println(
> "\n\nIf  you  want  to  delete  a  value  from  the set  press  'd':  ");
>     String  deleting  =  input.next();
>     if("d".equalsIgnoreCase(deleting))
>     {
>       System.out.printf(
> "\nYou  are  going  to  delete  a  value  from  the  set \n");
>       System.out.print("\nEnter  the  value  to  be  deleted:  ");
>       int  deleteValue  =  input.nextInt();
>       set.delete(deleteValue);
>     }
>  
>     System.out.print(
> "Enter  'u'  to  find  the  union\nEnter  'i'  to  find  the intersection\n" 
>       +"Enter  'c'  to  compare  the  sets\nIf  not  enter  'n'" );
>     String  option  =  input.next();
>     if("u".equalsIgnoreCase(option))
>     {
>       set.union(arraySetB);
>     }
>  
>     if("i".equalsIgnoreCase(option))
>     {
>       set.intersection(arraySetA);
>     }
>  
>     if("c".equalsIgnoreCase(option))
>     {
>       set.isEqualTo(arraySetC);
>     }
>     else  if("n".equalsIgnoreCase(option))
>     {
>       System.out.println("Thanks  for  using  my  program\n");
>     }
>  
>     set.toSetString();
>   }
> }

When I made your "isEqualTo()" method
(instead, use
<http://java.sun.com/javase/6/docs/api/java/util/Arrays.html#equals(boolean[],%20boolean[])> 

)
return boolean and compiled, there were no compile errors.

There was a runtime error:
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 102
>         at testit.IntergerSet.main(IntergerSet.java:194)

Line 194 was in this section:
>   for ( i = 0; i < 101; i++ )
>   {
>       j = i * 2;
>       arraySetA[j] = true;   // line 194
>   }

How big is arraySetA again?  And what is j equal to when i == 100?

--
Lew
0
Reply Lew 10/21/2007 12:58:50 AM

Ok, I need to work alot on this, thanks.


0
Reply sdlt85 10/21/2007 1:29:22 AM

Lew wrote:
>> Well here is my code again:
>
>No TABs in Usenet posts, please.

Here is a little tool that helps keep code (or text) 
shorter than a target length.  
<http://www.physci.org/twc.jnlp>  

It is sandboxed, and includes a button to 
'_R_eplace Tabs'.   

HTH

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200710/1

0
Reply Andrew 10/21/2007 2:05:49 AM

Ok, Thanks, I need to do alot of work.

0
Reply sdlt85 10/21/2007 9:26:17 AM

15 Replies
261 Views

(page loaded in 1.293 seconds)

Similiar Articles:


















7/15/2012 2:27:36 PM


Reply: