# Nested For Loops with Constants

• 01-27-2014, 06:05 PM
MrDan
Nested For Loops with Constants
I was hoping someone could explain the process how they are used. I'm failing to have a good understanding on how they work and coordinate with each other.

Code:

```public class tryit {         //constant value         public static final int BIG = 7;         //main         public static void main(String [] args){                                 for(int i = 1; i <= BIG; i++){                         //new for loop                         for(int k = 1; k <= BIG ;k++){                                 System.out.print("*");                 }                         //for(int k = BIG; k <= ( BIG + 3 ); k++){                                 //System.out.print("&");                                                         //}                         for(int k = 0; k <=  i; k++){                                 System.out.print("\$");                                                         }                         //for(int k = BIG; k >= i; k--){                                 //System.out.print("\$");                         //}                         System.out.println();         }         }```
• 01-27-2014, 06:08 PM
PhHein
Re: Nested For Loops with Constants
Post the code you're having problems with. Your question is too unspecific.
• 01-27-2014, 06:20 PM
MrDan
Re: Nested For Loops with Constants
I'm trying to understand how they can be manipulated and how to use them to directly impact the text, and make it look right.
• 01-28-2014, 08:23 AM
kjkrum
Re: Nested For Loops with Constants
What's wrong with it?
• 01-29-2014, 04:25 AM
AlexGraal
Re: Nested For Loops with Constants
Here is the output of your code (I ran it):
Code:

```*******\$\$ *******\$\$\$ *******\$\$\$\$ *******\$\$\$\$\$ *******\$\$\$\$\$\$ *******\$\$\$\$\$\$\$ *******\$\$\$\$\$\$\$\$```
Next time, you need to POST your output.

`public static final int BIG = 7;`