use if else statements in printMatrix() method
Example: if(yourBoolean)...;else...;
read Control Flow Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)
The while...
Type: Posts; User: serdar
use if else statements in printMatrix() method
Example: if(yourBoolean)...;else...;
read Control Flow Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)
The while...
you have used two Scanner objects and second object has only one character read from first object it doesn't have 3 characters
to resolve your problem use just first object when calling...