gudii9
asked on
difference of code nested for
package com.bharaththippireddy.trainings.jaxrs;
public class NestedFor2 {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 2; j++) {
System.out.print("six");
}
}
}
}
what is difference between above and below program
package com.bharaththippireddy.trainings.jaxrs;
public class NestedFor2 {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 2; j++) {
System.out.println("six");
}
}
}
}
both cases i am getting same output as
six
six
six
six
six
six
when i run inside main class
package com.bharaththippireddy.tra
public class NestedFor2 {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 2; j++) {
System.out.print("six");
}
}
}
}
please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sixsixsixsixsixsix
public class NestedFor2 {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 2; j++) {
System.out.print("six");
}
}
}
}