thanks jitesh that worked fine on the command line, but what i was looking for is the how does the program with main() , prompt user to enter the numbers, after program is run.

let me just print the whole problem : (maybe this will belong to

java beginner,but since you replied I will just type it here..thanks)

REMOVAL OF 'ZERO ROWS AND COLUMNS IN A MATRIX.

given an integer matrix of size, say, M x N, to write a program to remove all the rows and columns consisting of all zeroes.

INPUT SPECIFICATION:

the first line of input will have 2 integers , say M and N, separated by a space, specifying number of row and column in matrix.

This will be followed by M LINES, EACH consisting of N integers.

assuming M and N can be between 1 and 10 only.

/*now i have got the logic for the program but am a little (or majorly)confused with input classes . So if you or someone could please help me with this ....