wood burning stoves
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Enhanced for loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Enhanced for loop" Watch "Enhanced for loop" New topic

Enhanced for loop

Juwonlo Ibigbami
Ranch Hand

Joined: Nov 03, 2006
Posts: 83
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

Joined: Aug 16, 2005
Posts: 15093

Can you post some code to explain your question more clearly? What have you tried yourself, and where do you get stuck exactly?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Juwonlo Ibigbami
Ranch Hand

Joined: Nov 03, 2006
Posts: 83
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

Joined: Sep 27, 2006
Posts: 42

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 ?

I agree. Here's the link: http://aspose.com/file-tools
subject: Enhanced for loop
It's not a secret anymore!