ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 12 Weeks Ago, 5 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 27 Apr 2017 My Price 8.00

public class testforju

public class testforju {

static secondjulia ju2 = new secondjulia();

public static void main(String [] args){

int[][] array = ju2.CalculateTotalETforJulia();

for(int row=0;row<array.length;row++){

for(int col=0; col<array[0].length;col++){

 

System.out.println(array[row][col]);

 

}

}}

 

}

ju2 is a class, and ju2.CalculateTotalETforJulia() returns a 2d int array. When I call this method in  another class, if don't use any loop and just print it, I can get the correct answer. But when I try to use nest for loop to print this array, the output will be all "0". So my question is why this thing happen and how to solve it.  

Answers

(11)
Status NEW Posted 27 Apr 2017 02:04 AM My Price 8.00

-----------

Not Rated(0)