What about the "Foreach" of Java

public class LotteryArray {
* @param args
* @param args
public static void main(String[]args)
     final int MAX=10;
     int[][]odds=new int[MAX+1][];
     for(int n=0;n<=MAX;n++)
          odds[n]=new int[n+1];
     for(int n=0;n<odds.length;n++)
          for(int k=0;k<odds[n].length;k++)
               int lotteryOdds=1;
               for(int i=1;i<=k;i++)
                    lotteryOdds=lotteryOdds*(n-i+1)/i;
               odds[n][k]=lotteryOdds;
     for(int[]row:odds)
          for(int odd:row)
               System.out.printf("%4d", odd);
          System.out.println();
}I don't Know about below
for(int[]row:odds)
          for(int odd:row)
               System.out.printf("%4d", odd);
          System.out.println();
     }if every element of odds will fill in row?
and so the element of row will copy to odd?
pls pay attention to odd dosn't equal odds

okay,Got it
Thanks
but what i ask is about the Multidimensional ArraysA multidimensional array is just an array of arrays. I've never use the enhanced for loop with one, but I imagine it would be like this: // Old way
int[][] arr = ...;
for (int ix = 0; ix < arr.length; ix++) {
    int[] innerArray = arr[ix];
    for (int jx = 0; jx < innerArray.length; jx++) {
        int value = innerArray[jx];
        // do stuff with value
// Enhanced for loop
int[][] arr = ...;
for (int[] innerArray : arr) {
    for (int value : innerArray) {
        // do stuff with value
}

Similar Messages

  • What's the difference between Java SDK and the Enterprise Edition?

    What's the difference between Java SDK and the Enterprise Edition? Are they both free?

    both r free but they are used in diffrent applications. sdk are used for simple apps that run on your computer while j2e (enterprise edition) are ment for large distributed computer systems that include servers and such. if you don't know the diffrence you probably wont need the the j2e, only the sdk.

  • Do I need Java 8 or should i disable it? What happens if i disable it? And what is the difference between Java and Java Runtime?

    Do I need Java 8 or should I disable it? What happens if i disable it? And what is the difference between Java and Java Runtime?

    There's no difference. They're both runtime plug-ins (they run when an app calls for Java functions).
    You only need Java if you either have Java apps on your Mac that won't run without having it installed, or you use trusted web sites that require Java to function (getting fewer and far between). Otherwise, you have no need for it at all.

  • What is the role of java in the netweaver platform

    Hi All
    sapnetweaver platform is the integration of the java and abap.then what is the role of java in that netweaver platform
    regards
    Sunil

    Hi Sunil,
            Java makes Sap NetWeaver more powerfull than it was before.
           One of the new additions to the Java functionality of NetWeaver includes the Java Virtual Machine container technology. This will allow standard Java code to run on a framework around the Java Virtual Machine itself. It does this by reducing the number of parallel users per virtual machine. It also improves on the overall memory consumption, the application stability and the number of affected users in the event of a screen freeze, loss of data or the need for re-keying of information.
          The JVM technology also includes several added features designed to assist developers in managing error resolutions. This includes the ability for developers to switch a user process in the production system in or out of debugging mode on the fly allowing for minimum downtime. While also including tracing and monitoring tools for error analysis and hopefully a quick resolution.
             So now, not only does NetWeaver offer support for such standards as HTTP, XML, Web services and of course ABAP, but now it also offers support for Java. All of this adds to SAP’s future interoperability with such applications as Microsoft .NET and IBM WebSphere.
             Now that SAP NetWeaver supports Java we will start to see a real positive impact in the marketplace for those who are in search of a cost-effective means to deploy and manage Java applications in their enterprise and small businesses. For companies of all sizes looking for a way to adapt quickly to market changes, respond to unforeseen challenges and to seize new opportunities, SAP NetWeaver is a tool that is worth looking into.

  • What is the necessacity  of Java in SAP

    What is the necessacity of Java (J2ee engine) in SAP 4.7 ee and above if there is invocation of Http:// is there with help of  RFC to connect NON-SAP systems.

    Hey,
    In terms of XI usage of j2ee engine
    Java Stack:
    -Adapter Engine (AE)
    -Integration Builder, SLD, RWB
    -Standard Mapping
    -Java Mapping
    -XSLT Mapping
    -CPA cache .
    In terms of SAP 4.7 EE check this
    J2EE Technology in SAP Web Application Server
    http://help.sap.com/saphelp_47x200/helpdata/en/13/a3bb3eff62847ae10000000a114084/frameset.htm
    <b>Cheers,
    *RAJ*
    *REWARD POINTS IF FOUND USEFULL*</b>

  • Which Bag do you use for your Camera? What about the GadgetBag 300EG?

    Which Bag do you use for your Camera? What about the GadgetBag 300EG?

    I agree - it's all about preference.  I use the ThinkTank Retrospective 7.  I *love* ThinkTank's attention to detail...  everything from having a rain cover included with the bag, to having ingenius use of velcro (sp?) patches to enable you to "silence" the bag so it doesn't make the big "SCRATCH" sound when opening the bag during a quiet event, etc.
    My best advice would be to do your research (which you're clearly doing) and have a clear understanding of the return policy wherever you buy it, and then don't be afraid to return it if you get it and feel it doesn't meet your needs.  A restocking fee is a small price to pay to not be stuck with a bag that doesn't work for you.  And if for any reason you get it and can't return it, there's always eBay. 

  • TS1717 What about the same issue happening on OSX 10.7.5? Troubleshooting freezes or launch issues...

    What about the same issue happening on OSX 10.7.5? Troubleshooting freeze or launch issues...

    Refer to following articles to remove SC file(s):
    Win 7/Vista http://support.apple.com/kb/TS2363
    WinXP http://support.apple.com/kb/TS1776
    Then proceed to repair your Quicktime:
    Control Panel >
    Win7/Vista - Programs n Features.
    WinXP - Add n Remove Programs
    Hightlight QUICKTIME and click CHANGE then REPAIR.

  • I want to produce wedding dvds.whats the best software to use...final cut x I'm thinking but what about the quality of the dvd?

    i want to produce wedding dvds.whats the best software to use...final cut x I'm thinking but what about the quality of the dvd? Can i use idvd?

    The only Programms I worked with are DVD Studio Pro and iDVD. You can burn a Video-DVD with Toast but  there is no real option to design your Menu. Just a few themes as far as I discovered.
    Do you have a Blue Ray Device to burn* the HD-DVD? Are the Bride and Groom able to watch the Blue Ray?
    * which is only possible with DVD Studio Pro and not iMovie as far as I know.
    This might help
    For better quality I would go the Compressor & DVD Studio Pro workflow I just learned.
    Export the Movie as is from Final Cut Pro and then use Compressor to encode the File.
    Consider delivering the Movie in a different way like a private video on vimeo, a Website or on an SD card which is not really romantic...

  • HT1657 Can I watch my rented movie for just 24 hours? What about the 30 days? The countdown on my library returned in days countdown rather than hours. Can anyone clarify me about this?

    Can I watch my rented movie for just 24 hours? What about the 30 days? The countdown on my library returned in days countdown rather than hours. Can anyone clarify me about this?

    Read the article you linked
    iTunes Store: Movie rental frequently asked questions (FAQ)
    How long do I have to watch a rented movie?
    You have 30 days from the time of rental to watch your movie, and 24 hours (in the US) or 48 hours (elsewhere) after you've started viewing to finish it. Once the rental period expires, the movie will disappear from your iTunes library."

  • HT1338 what about the problems with the trojan virus is that a problem for my mac as well?

    What about the problems with the Trojan virus will this be a problem also for me using Mac

    What Trojan?
    If you're referring to the DNS Changer Trojan, it's highly unlikely you're affected. The actual distribution of the trojan was stopped several years ago and the perpertrators jailed.
    The FBI has been maintaining the servers used by the trojan for the last 5 years in order to give affected systems time to be purged. They will finally shut them down on Monday.
    Ensure that your router and the Mac's network settings are set for the DNS addresses of your ISP, or if you're not sure what they should be, change them to Open DNS using the IP addresses;
    208.67.222.222
    208.67.220.220

  • What about the apple remote on iMac 2012?

    Hi, I'll buy a new iMac 2012 but what about the apple remote? A new one will be released? Or bye bye the remote?

    Yep there are some other posts already here about that and many others in the now deleted pre release board.

  • HT1918 What about the verification questions? the ones like "way was your first job?" or "your favorite teacher?" I just got a new iPod and forgot the answers to those questions, and need to change them..

    What about the verification questions? the ones like "way was your first job?" or "your favorite teacher?" I just got a new iPod and forgot the answers to those questions, and need to change them.. not sure how, but I need to do that in order to download new stuff on my new ipod

    Funds cannot be transferred from one Apple ID account to another.
    Try here > Rescue email address and how to reset Apple ID security questions
    If that doesn't help, contact Apple for assistance with your security questions > Contacting Apple for support and service

  • BBM Across Platform, what about the older devices?

    Yes, as we all heard is that bbm is coming to android and Iphone. We all know that BB10 does not us BIS and the older devicec need BIS to operate to the full, why can blackberry not open this to all so that i can bbm without BIS on my older device? yesBIS is nice but what about the people that want to use their older phones like the BB10.
    Only some features work without BIS, like the excample whatsapp, browser but all the good stuff like Blackberry world are blocked as well as Blackberry Protect, Facebook and so i can go on ....
    Let the people that want BIS get it like that and the other that want it without BIS get it like that then Blackberre will be more flexible.
    Cant they see they will now loose more customers to the other platforms where they can keep the people on the older native devices ....Please Blackberry UNBLOCK US ....

    Yes, 1.19GB of "other" is normal.  Normal is a little over 1GB.

  • I have to reinstall WIN 7 Pro on my PC, what about the CC app's? Can I reinstall them later again?

    I have to reinstall WIN 7 Pro on my PC, what about the CC app's? Can I reinstall them later again?

    The CC has been activated twice on 26th April &28th April 2014. You need to deactivate it first from any of the CC installed .
    (Activation & Deactivation Help)
    The other option is to deactivate it while installing for the third time. this will deactivate CC from both the earlier installed machines(I understand, it is being reinstalled on one of machine which had CC).
    To reactivate it on the one of the previous machine, you need to launch any product, there shall be a prompt
    , in that prompt there will be an option to " license the software", please click on that & sign in.
    It will reactivate the CC on the first machine.
    Regards
    Rajshree

  • Mifi 4510L Mifi Hotspot...is it the network? and what about the firmware update?

    I have spent several months trying to seek a solution on the repeated and frequent disconnects from the Verizon wireless network using my Mifi 4510 L.  No success.  I have conversed with Verizon Wireless "experts" on this matter and have basically been ignored, since they do not have a solution. It has cost me a pretty penny in wireless costs due to lost connections in downloads, etc...for which I do not get any credit from Verizon on my wireless bill...go figure.
    I have even been accused by Verizon that the problem is my computer and hardware, even though I have ran several hardware, software, and "real-life" connection checks on other wireless networks with no issues at all.  I even have been getting better connectivity when I use my Verizon USB UML290...but I hate having to switch moving my SIM card from the USB Modem to the MIfi4510L...one of these days the SIM card will fail. Verizon has checked the signal strength at my home and work locations (which I already knew as good), but never heard back from them.
    Anyway,  I have verified that my wireless network adapter works just fine on other wireless networks (no dropouts, etc).  I have even upgraded to another Windows Operating System - Windows 7...which is more superior than Vista in dealing with wireless communications.  I have implemented quite a number of the solutions provided by other great Verizon Wireless Community members, but the connectivity problems continue to occur.
    When I did a review of my wireless hardware logs, I noticed that when I was encountering problems, the dynamically assigned address given to me on the Verizon Wireless network changed quite a bit, even when I was using the same web site. When my wireless connection worked fine, the dynamically assigned address was consistent.  This seemed to change when I encounter peak network load times. 
    I would appreciate a straight answer from Verizon Wireless on what is going on with the network.  I live in a solid 3G coverage area...but just far away from 4G to benefit for the increased throughput.  The closest 4G location footprint is about 40 miles away from me.
    Finally, what about the Mifi 4510 L firmware update?  I have yet to see any notification about this firmware update, either through normal e-mail channels or even through my Mifi configuration site
    http://192.168.1.1/mifi.cgi
    What gives?
    I realize that I am sounding a little perturbed about this matter, but it has been almost 4 months now...and Verizon is not living up to their part of the bargain on providing good tech support on the Mifi 4510L.  When they do not have an answer...they ignore the customer.   Not good business!!!
    Kevin Smith
    Metropolis, IL

    kescom11 wrote:
    Finally, what about the Mifi 4510 L firmware update?  I have yet to see any notification about this firmware update, either through normal e-mail channels or even through my Mifi configuration site 
    The firmware update was released a few weeks ago and there were multiple threads in this forum for it:
    Software Update: Verizon Wireless 4G LTE Mobile Hotspot MiFi™ 4510L
    The firmware update primarily addresses a problem with the MiFi switching from 3G to 4G and back.  I would not expect it to resolve a connection issue for anyone in a 3G only area.  Work through the firmware update instructions included in the link above and see if it helps. 
    There were no email notifications but the MiFi should have been redirecting you to the MiFi homepage every time you tried to browse the internet.  The firmware update is mandatory so if you have not already completed the update then there might be something wrong with your device. 

Maybe you are looking for