| | |
why doesn't it overwrites the array
![]() |
•
•
Join Date: Jun 2009
Posts: 28
Reputation:
Solved Threads: 0
this program divides the array into 6 segments of two elements each.but with each iteration the new array is not overwritten and it keeps displaying the first two values of the array 'array'
Java Syntax (Toggle Plain Text)
class tryy { public static void main(String args[]) { double array[]={12.43,34.34,4.432,9.433,4.787,4.2987,57.93,4.279,8.379,83.472,8.9867,879.56}; for(int i=0;i<array.length;i++) { for(int j=0;j<(int)(array.length/6);j=j+2) { double numbers[]=new double[2]; System.arraycopy(array,j,numbers,0,2); for(int u=0;u<numbers.length;u++) {System.out.println(numbers[u]);} } } } }
![]() |
Similar Threads
- Logic Error in Java Recursive Method (Java)
- read line of text from file into array (C++)
- Php session array help please (PHP)
- Programming VBA: Reading excel into an Array (Visual Basic 4 / 5 / 6)
- How to read excel cells into Array (Visual Basic 4 / 5 / 6)
- Array Sorting on a User Supplied Element (Java)
- .txt/array problems (C++)
- Run-time Error when printing Array Contents. (C)
Other Threads in the Java Forum
- Previous Thread: getting nullpoint exception again
- Next Thread: hw do i return a temperature of a roomclass
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle plazmic print problem program programming project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree unlimited utility webservices windows






