• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enhanced for loop

 
Juwonlo Ibigbami
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi in the house, please can eny body explain to me how to used enhanced for loop to asign value to an array of array at runtime using scanner

Juwonlo(scjp prep.)
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15452
42
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post some code to explain your question more clearly? What have you tried yourself, and where do you get stuck exactly?
 
Juwonlo Ibigbami
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,Explainingmyselfbetter,
Given:
int[][] a =new A[5][]
How can i use the enhanced for loop to assing values to the arrays inside array decleared above.
 
Omer Haderi
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aloha...

There is no such thing in java int[][] a =new A[5][]...

If you mean int [][]a = new int[4][]; then you can use it like this in the enhanced loop:


PS: is it difficult to separate the words when asking questions ?

cheers!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic