# ARRAY SIZE.

jas
ARRAY SIZE.
Posted in : Java Beginners

September 30, 2008 at 10:23 AM

Hi friend,

Do some changes for compile and run the code correctly

int num2= numbers*2;

Code :

import java.io.*;
import java.util.ArrayList;

public class CopynDouble1
{
public static void main(String[] param){
try{

ArrayList<Integer> A = new ArrayList<Integer>(); //array A
ArrayList<Integer> B = new ArrayList<Integer>(); //array B

System.out.print("Input number: ");
int numbers = Integer.parseInt(userInput); //integer version of userInput;

while(numbers != 0){
int num2= numbers*2;
System.out.println(B); // Don't know how to print array B in this case.
System.out.print("Input number: ");
numbers = Integer.parseInt(userInput);
}
}

catch(Exception e){
}
}
}

http://www.roseindia.net/java/

Thanks

September 30, 2008 at 12:01 PM

Hi

B is ur ArraayList Object, So u can.t use any aritmatic operation on that object.

in ur code just modify
while(number !=0){

}

Thanks
Rajanikant

October 2, 2008 at 2:24 AM

ThankYou Very Much Rajanikant and Deepak.
I can't ThankYou Guys enough for helping me in solving this code.

calculate size of array
calculate size of array  Is it possible to calculate the size of array using pointers in Java
ARRAY SIZE!!! - Java Beginners
ARRAY SIZE!!!  Hi, My Question is to: "Read integers from... to initialize the array when you don't know the size of the array. Just to get...). Vector is a growable array. Here no need to define the intial size of ur
ARRAY SIZE. - Java Beginners
ARRAY SIZE.  Thanks, well that i know that we can use ArrayList... the elements in array A. Then doubled array A by multiplying it by 2 and then storing it in array B. But gives me error. import java.io.*; import
JavaScript array size
JavaScript array size     ... you in understanding JavaScript array Size. The code shows you a HTML Page ... is assigned to array [count]. The function show( ) include the variable string return
Create array of random size
Create array of random size In this tutorial, you will learn how to create... the Random class, we have set the random size to array. We have stored... the size of array, the code catch out-of-bounds exceptions and display "
Get Array Size
Get Array Size   ... the size of these array.? The array.length is used to find out the size... is the video tutorial of "How to get size of array in Java?"
JSP List Size
of the list. The JSP List Size uses array list object to add the elements and finally... of elements in the array. l.size : The method returns the size list... JSP List Size
Array
Array  can we create an array of size 1 lakh in java programming
Array
("Enter Range: "); int size=input.nextInt(); int array[]=new int[size]; System.out.println("Enter Array Elements: "); for(int i=0;i<...Array  How do i insert elements into an array up to a limit from
Array in Java
An Array is the static memory allocation that holds a fixed number of values of same type in memory. The size or length of an array is fixed when the array...[] = {50,60,70,80,90}; The size of this array will be 5 elements. *There is another way
JavaScript Array undefined
JavaScript Array undefined       Undefined array is a condition that occurred when a user want to print an array element more than the declared size of element that an array
in_array
in_array  in_array in php
is _array()
is _array()  is _array()   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php \$yes = array('Hello', 'World'); echo is_array(\$yes) ? 'Array
is _array()
is _array()  is_array() in php   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php \$yes = array('Hello', 'World'); echo is_array(\$yes) ? 'Array
Size of commarea
Size of commarea  hii, What is the size of commarea?   hello, Default size of commarea is 65k
C Array default values
in Array. The example below contains an array arr of integer type. The maximum size of the array is 4. We have allocated only two values in the array like this:  ... C Array default values
Array
Array  how can i use elements of an array in a circular form? that is if the searching of the element reach the last elements of the array, then it will start serching from the begining of the array
Array
Array  is it possible to define array like this..? int[] intArray = new int[] {4,5,6,7,8}; Explain...?   Yes, you can. Java Initialize Array
Array
Array  What if i will not declare the limit index of an array, how will I declare an array and store values with it using loop?   Hi Friend...(System.in); int array[]=new int[5]; System.out.println("Enter Array Elements
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1
Size in FLex
Size in FLex  Hi..... What is the difference between width, explicitWidth, measuredMinWidth, measuredWidth, and percentWidth? please tell me about that difference Thanks
array
array  WAP in java to store 6 element in array P and 4 element in array Q. Produce the third arra y R containing all element from p & q
array
array  array memory allocation is dynamic or static in java   Java Arrays have dynamic memory allocation
Size in FLex
Size in FLex  Hi... I just want to know about... What happens in measure()? measuredHeight, measuredWidth, measuredMinHeight, measuredMinWidth are set. please give me an example with description... Thanks
array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element
array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element
array
array  take a 2d array and display all its elements in a matrix fome using only one for loop and ple explain the program in below
array
accepts a pointer to integer which represents an array of integer.After that this method prints the entire of the array numbers to the monitor. include using std::cout; using std::endl; void printArray(int *array, int count
array
array  How to store the results of mysql query in an array... qurey in array: "select distinct(EMPLID)from tblwork where EMPLID not in (select... store the result in array