Java and C random conversions

I have the following code in C (gcc compiler)
#include <stdio.h>
#include <stdlib.h>
int main()
     int i = 9;                    
     srandom(5412);               
     while (i-- > 0) {
          printf("%d\n", random()%6);     
     return 0;
I wanna convert the above code into Java so I program the following:
import java.util.*;
public class Generator{
     public static void main(String argv[]){
          Random a=new Random();
          a.setSeed(5412);
          int azar;
          for (int i=0;i<9;i++){
               azar=(int)(a.nextInt(6));
               System.out.println(azar);
But the results that I have get are different, when they should be the same.
Any suggestion?

JMGC wrote:
somebody could give some theoretical reason why a Random number generated in Java with the same seed is different than a C generated one?They theoretically could be different if they use the seed in different ways, or use a different algorithm to generate the random number. You have already been told this several times.
or they should be the same?Probably not.
Thanks to everybody that is helping me until now

Similar Messages

  • Data conversion for communication between Java and C/C++ program

    The real problem, i guess, is about data type conversion between Java and C programs. For instance, and int is supposed to be 4 bytes in Java, and also in C/C++. But, as far as I know, the size of and int in C depends on the processors architecture, so if it were a 64 bit arch., size of and int, double, etc. in C, would change. The real scenario would be a communication between a 32 bit machine (Java) and a 64 bit machine (C/C++).
    First of all, is this assumption correct?
    If so,
    how is it possible to deal with this problem in Java?
    Is there any way to know 'type length' automatically? or
    would it be necessary to modify the Java program to work with a C program in 32-bit or 64-bit arch?
    thx in advance

    cotton.m wrote:
    Yes you should develop the C part of the protocol first and then build from there.
    See http://forum.java.sun.com/thread.jspa?threadID=5243547 for a previous discussion of this topic.
    I understand what you mean, also the topic you referenced. I will explain the situation a bit more. The protocol is already defined: (16 bits message size, 16 message id, 32 bit time, etc.); it is also defined in C (structures and so on). So it would be easy to write my Java code using the specified protocol in bytes, and C types wouldn't be necessary to be considered. But, let's say that the C code can't be modified, and I thought (and don't know yet if its correct), that size of C types CAN changed depending on architecture. So if size changes for C types (code is specified in short, int, etc, and not in bit format), it all would be a mess, if I don't implement something in my Java code.
    cotton.m wrote:
    I don't believe that 32 or 64 bit enters the equation here at all.Maybe 32 o 64 doesn't mind, but sparc or PC could take a point here. Communication would be between a sun solaris sparc and windows x86 PC. But if type size in C/C++ does not change, I wouldn't really have any problem then...
    The situation is not ideal, I know, but is what I have; and I think I could have problems if I run the C program in other machines; so I would have to try to solve it whithin my Java Program.
    I hope it is clear now what I need.
    thx
    Edited by: MGasa on Jan 16, 2008 1:51 AM

  • What is the use vss in java and how to use it?

    can i know what is vss in java and how to use it and also can you tell me related vss like svs?
    and what are tools for configuration in real we will use?
    am i student i want to know these all?

    jduprez wrote:
    You do not need to know them all, but one for sure, since it is a must for multi-developer team.8o( ?????
    It is a must. Period.
    OK, let's tone down: it is a must for any job related to software production. Not only development.That begsl the question, What does it mean to "know" one of these systems? I would expect Product Management, Documentation, QA, and Support staff to be conversant with the fundamentals of such a tool--check in, check out, version/revision numbers--but not much more than that. Developers, on the other hand, I would generally expect "know" the system with a much higher level of expertise--query language, branching, merging, and so on.

  • I "allowed" Java Deployment Toolkit, it made me upgrade java, and now there are ads everywhere

    I was doing homework on masteringgenetics and there was this box in the top left hand corner that said to allow java deployment toolkit because some of the content on the website needed it so I clicked "always allow". This then took me to java's website to update java and I was gullible so I did. Now there are random ads on most websites I go to and if I stay on there it takes me to some random website. I've tried disabling all plugins, uninstalling java, uninstalling then reinstalling firefox, but it still happened. It doesn't happen when I use google chrome so I think it's a firefox thing (actually now it's happening on chrome too).

    Oracle may be bundling other software with a Java update, so always be careful when installing or updating programs like Java and Flash and look carefully for any check boxes to installs such unwanted extras.
    You can check in "Windows Control Panel > Programs" for recently installed programs (sort by installed time) to see if any suspicious software shows up.

  • Java and UML !!!

    I need some help with a university project, where i have to convert UML models in Java source code.
    I have to develop a tool which takes in UML models and outputs an e-commerce application.
    Are there any web-sites which have good examples of UML to java.?
    I am really stuck on this so if anyone could help it would be much appreciated!
    Many Thanks.

    Hi aashish24 ... thanks for your reply.
    Would Rational Rose show me the actual conversion. So if I drew out a UML model into Rose, how do i go about converting it into Java, and would the tool show me the actual and whole java code for the UML model.
    I also would like to know if there are any web-site which show a good conversion from UML models to Java code.
    Many Thnks for your help.

  • Why are Java and Video Player updates appearing in Safari

    Today these fake Java and Video Player update pop ups started appearing in Safari 6.2.4, in OS 10.8.5.  The Java updates say I need  version 13 which doesn't exist and the video player pop ups are gray with a red square that resemble the Adobe colors.  These are popping up on almost every page I load in Safari.
    I've looked in the Launch Daemons folder and that other Launch folder that keeps being recommended in the post that says I don't need to download anything and there is nothing out of the ordinary there.  How do I stop these pop ups?
    Tracy

    The update alerts are indeed fake, and are intended to dupe you into installing malware or disclosing private information so that your identity can be stolen.
    You might get the alerts when visiting a website that has been hacked. Don't visit the site again. If applicable, notify the site administrator of the problem, but don't send email to an unknown party.
    If you get the alerts when visiting more than one well-known website, such as Google, YouTube, or Facebook, then they may be the result of an attack on your router that has caused you to get false results from looking up the addresses of Internet servers. Requests sent to those sites are redirected to a server controlled by the attacker. It's possible, but less likely, that the DNS server used by your ISP has been attacked.
    Back up all data.
    Unlock the Network preference pane, if necessary, by clicking the lock icon in the lower left corner and entering your password. Cllck Advanced, open the DNS tab, and change the server addresses to the following:
              8.8.8.8
              8.8.4.4
    That's Google DNS. Click OK, then Apply.
    In Safari, select
              Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data
    and confirm. If you’re using another browser, empty the cache. Test. If the fake update alerts stop, see below. Otherwise, ask for instructions.
    The router's documentation should tell you how to reset it to the factory default state. Usually there's a pinhole switch somewhere in the back. It may be labeled "RESET." Insert the end of a straightened paper clip or a similar tool and press the button inside for perhaps 15 seconds, or as long as the instructions specify.
    After resetting the router, quit the web browser and relaunch it while holding down the shift key. From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data
    and confirm. Do the equivalent if you use another browser. Open the Downloads folder and delete anything you don't recognize.
    Then go through the router's initial setup procedure. I can't be specific, because it's different for every model. The key points are these:
    1. Don't allow the router to be administered from the WAN (Internet) port, if it has that option. Most do.
    2. Set a strong password to protect the router's settings: at least ten random upper- and lower-case letters and digits. Don't use the default password or any other that could be guessed. Save the password in your keychain. Any password that you can remember is weak.
    3. If the router is wireless, or if you have a wireless access point on the network, use "WPA 2 Personal" security and set a different strong password to protect the network. If the router or access point doesn't support WPA 2, it's obsolete and must be replaced.
    During the time the router was compromised, you were redirected to bogus websites. If you ever connected to a secure site and got a warning from your browser that the identity of the server could not be verified, and you dismissed that warning in order to log in, assume that your credentials for the site have been stolen and that the attacker has control of the account. This warning also applies to all websites on which you saw the fake update alerts.
    Check the router manufacturer's website for a firmware update.
    If you downloaded and installed what you thought was a software update, ask for instructions.

  • Sorting a two-dimensional array to check min and max random results.

    I am working on a new project to learn more advanced uses of java, and have run into some very confusing output. the program should roll 2 6 sided dice 36000 times, storing the results (how many times each of the 21 possible combinations of rolls occurred) in a 2-d array, printing that array in tabular format, then copying the values to a 1d array to sort numericallly (ascending) then print which combination of rolls occured least and most, with how many occurences for each (least and most) here is the code I have, the error will be below it.
    package d12;
    //import classes to use
    import java.util.Random;
    import java.util.Arrays;
    public class randomDice2D {
         * @param args the command line arguments
        public static void main(String[] args) {
    //bring in new Random object
            Random r = new Random();
    //declare all variables and arrays
            int[][] dieResults; dieResults = new int[6][6];
            int[] sortingResults; sortingResults=new int[37];
            int one;  int two;  int three;  int four;  int five;  int six;
            int seven;  int eight;  int nine;  int ten;  int eleven;  int twelve;
            int thirteen;  int fourteen;  int fifteen;  int sixteen;  int seventeen;
            int eighteen;  int nineteen;  int twenty;  int twentyone;
            //initialize all variables at 0
            one=0;  two=0;  three=0;  four=0;  five=0;  six=0;  seven=0;  eight=0;
            nine=0;  ten=0;  eleven=0;  twelve=0;  thirteen=0;  fourteen=0;
            fifteen=0;  sixteen=0;  seventeen=0;  eighteen=0;  nineteen=0;
            twenty=0;  twentyone=0;
    //do dice rolling and count each iteration of each possible result - 36 possible??
            for (int i = 0; i < 36000; i++)
              int roll  = (r.nextInt(6) + 1) ;
              int roll2 = (r.nextInt(6) + 1) ;
            if (roll ==1 && roll2 == 1) ++one;
            if ((roll == 1 && roll2 == 2) || (roll2 == 1 && roll == 2)) ++two;
            if ((roll == 1 && roll2 == 3) || (roll2 == 1 && roll == 3)) ++three;
            if ((roll == 1 && roll2 == 4) || (roll2 == 1 && roll == 4)) ++four;
            if ((roll == 1 && roll2 == 5) || (roll2 == 1 && roll == 5)) ++five;
            if ((roll == 1 && roll2 == 6) || (roll2 == 1 && roll == 6)) ++six;
            if (roll == 2 && roll2 == 2) ++seven;
            if ((roll == 2 && roll2 == 3) || (roll2 == 2 && roll == 3)) ++eight;
            if ((roll == 2 && roll2 == 4) || (roll2 == 2 && roll == 4)) ++nine;
            if ((roll == 2 && roll2 == 5) || (roll2 == 2 && roll == 5)) ++ten;
            if ((roll == 2 && roll2 == 6) || (roll2 == 2 && roll == 6)) ++eleven;
            if ((roll == 3 && roll2 == 3)) ++twelve;
            if ((roll == 3 && roll2 == 4) || (roll2 == 3 && roll == 4)) ++thirteen;
            if ((roll == 3 && roll2 == 5) || (roll2 == 3 && roll == 5)) ++fourteen;
            if ((roll == 3 && roll2 == 6) || (roll2 == 3 && roll == 6)) ++fifteen;
            if (roll == 4 && roll2 == 4) ++sixteen;
            if ((roll == 4 && roll2 == 5) || (roll2 == 4 && roll == 5)) ++seventeen;
            if ((roll == 4 && roll2 == 6) || (roll2 == 4 && roll == 6)) ++eighteen;
            if (roll == 5 && roll2 == 5) ++nineteen;
            if ((roll == 5 && roll2 == 6) || (roll2 == 5 && roll == 6)) ++twenty;
            if (roll == 6 && roll2 == 6) ++twentyone;
            //assign results to array
            dieResults[0][0]=one;
            dieResults[1][0]=two; dieResults[0][1]=two;
            dieResults[2][0]=three;dieResults[0][2]=three;
            dieResults[3][0]=four;dieResults[0][3]=four;
            dieResults[4][0]=five;dieResults[0][4]=five;
            dieResults[5][0]=six;dieResults[0][5]=six;
            dieResults[1][1]=seven;
            dieResults[2][1]=eight;dieResults[1][2]=eight;dieResults[3][1]=nine;
            dieResults[1][3]=nine;dieResults[4][1]=ten;dieResults[1][4]=ten;
            dieResults[5][1]=eleven;dieResults[1][5]=eleven;
            dieResults[2][2]=twelve;
            dieResults[3][2]=thirteen;dieResults[2][3]=thirteen;
            dieResults[4][2]=fourteen;dieResults[2][4]=fourteen;
            dieResults[5][2]=fifteen;dieResults[2][5]=fifteen;
            dieResults[3][3]=sixteen;
            dieResults[4][3]=seventeen;dieResults[3][4]=seventeen;
            dieResults[5][3]=eighteen;dieResults[3][5]=eighteen;
            dieResults[4][4]=nineteen;
            dieResults[5][4]=twenty;dieResults[4][5]=twenty;
            dieResults[5][5]=twentyone;
            //print results
            for (int j=0; j<dieResults.length; j++){
                System.out.print("\n");
                for (int k=0; k<dieResults.length; k++){
                System.out.print("|"+dieResults[j][k]+"| ");
            // Verify program accuracy and ensure total reported results add up to 36000
    System.out.println("\nValidate: 1's; "+dieResults[0][0]+" 1 & 2; "+dieResults[1][0]+
            dieResults[0][1]+" 4's; "+dieResults[2][0]+dieResults[0][2]+" 5's; "
            +dieResults[3][0]+dieResults[0][3]+" 6's; "+dieResults[4][0]+dieResults[0][4]
            +" 7's; "+dieResults[5][0]+dieResults[0][5]);
    System.out.println("All total rolls add up to " + (dieResults[0][0] + dieResults[0][1] +
             dieResults[0][2] + dieResults[0][3] + dieResults[0][4] + dieResults[0][5]));
    //check lowest/highest numbers entered to verify results are reasonable
    //sort results to obtain lowest and highest number of rolls
        for (int l=0; l<sortingResults.length;l++){
         for (int m=0; m<sortingResults.length;m++){
            sortingResults[l]=dieResults[l][m];
    Arrays.sort(sortingResults);
    //determine and print what roll occurred the least
        if (sortingResults[0] == two)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2's with " + sortingResults[0]);
        if (sortingResults[0] == three)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3's with " + sortingResults[0]);
        if (sortingResults[0] == four)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4's with " + sortingResults[0]);
        if (sortingResults[0] == five)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5's with " + sortingResults[0]);
        if (sortingResults[0] == six)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6's with " + sortingResults[0]);
        if (sortingResults[0] == seven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "7's with " + sortingResults[0]);
        if (sortingResults[0] == eight)
            System.out.println("The lowest number of rolls for a single result is "
                    + "8's with " + sortingResults[0]);
        if (sortingResults[0] == nine)
            System.out.println("The lowest number of rolls for a single result is "
                    + "9's with " + sortingResults[0]);
        if (sortingResults[0] == ten)
            System.out.println("The lowest number of rolls for a single result is "
                    + "10's with " + sortingResults[0]);
        if (sortingResults[0] == eleven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "11's with " + sortingResults[0]);
        if (sortingResults[0] == twelve)
            System.out.println("The lowest number of rolls for a single result is "
                    + "12's with " + sortingResults[0]);
    //determine and print what roll occurred the most
        if (dieResults[5][5] == two)
            System.out.println("The highest number of rolls for a single result is "
                    + "2's with " + dieResults[10]);
        if (dieResults[5][5] == three)
            System.out.println("The highest number of rolls for a single result is "
                    + "3's with " + dieResults[10]);
        if (dieResults[5][5] == four)
            System.out.println("The highest number of rolls for a single result is "
                    + "4's with " + dieResults[10]);
        if (dieResults[5][5] == five)
            System.out.println("The highest number of rolls for a single result is "
                    + "5's with " + dieResults[10]);
        if (dieResults[5][5] == six)
            System.out.println("The highest number of rolls for a single result is "
                    + "6's with " + dieResults[10]);
        if (dieResults[5][5] == seven)
            System.out.println("The highest number of rolls for a single result is "
                    + "7's with " + dieResults[10]);
        if (dieResults[5][5] == eight)
            System.out.println("The highest number of rolls for a single result is "
                    + "8's with " + dieResults[10]);
        if (dieResults[5][5] == nine)
            System.out.println("The highest number of rolls for a single result is "
                    + "9's with " + dieResults[10]);
        if (dieResults[5][5] == ten)
            System.out.println("The lohighestwest number of rolls for a single result is "
                    + "10's with " + dieResults[10]);
        if (dieResults[5][5] == eleven)
            System.out.println("The highest number of rolls for a single result is "
                    + "11's with " + dieResults[10]);
        if (dieResults[5][5] == twelve)
            System.out.println("The highest number of rolls for a single result is "
                    + "12's with " + dieResults[10]);
    }the output I got was this:
    run:
    |988| |2038| |1933| |2008| |2095| |2002|
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 6
    |2038| |965| |1973| |1982| |1985| |2028|
    |1933| |1973| |1034| |1952| |1928| |2055|
    |2008| |1982| |1952| |1010| |1981| |2023|
    |2095| |1985| |1928| |1981| |1041| |1996|
    |2002| |2028| |2055| |2023| |1996| |983| Validate: 1's; 988 1 & 2; 20382038 4's; 19331933 5's; 20082008 6's; 20952095 7's; 20022002
    All total rolls add up to 11064
            at d12.randomDice2D.main(randomDice2D.java:101)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)I can see from the validate line in output that i need to start that line with a \n and change the formula of that println from
    +dieResults[x][y]+dieResults[y][x]+
    to
    +(dieResults[x][y]+dieResults[y][x])+
    I am also aware i have to finish listing all the elements of the array to add to the all total rolls line, but that I can add as I wait for an answer to the errors I don't see the solutions to. The last thing I need help with is how to print those results in a 2-d table format instead of one number per line. Should I change the pair of loops here:
    for (int l=0; l<sortingResults.length;l++){
         for (int m=0; m<sortingResults.length;m++){
            sortingResults[l]=dieResults[l][m];
            }    }to a single loop repeated till the end like this?
    for (int l=0; l<6; l++){
    sortingResults[l]=dieResults[l][0];}
    for (int m=0; m<5; m++){
    sortingResults[(m+6)]=dieResults[m][1];}
    for (int n=0; n<4; n++){
    sortingResults[(n+11)]=dieResults[n][1];}or just take 21 lines (or 36 if i track all results instead of all unique) to declare each element like:
    sortingResults[a]=dieResults[x][y];
    Edited by: Geode on Oct 20, 2010 12:38 AM

    Ok, I have done a lot and thought I had worked out all of the problems. Netbeans had no problems compiling it or running it, and the output was exactly what I expected it to be. Then I decided that the println starting "Validate:" was unneccessary since I printed the table right before it, so I deleted it. Noww Netbeans is telling me it compiles with errors every time i run it, even though it doesn't flag any line as having an error and it still executes exactly as I expect it to. Also, I was not able to find a way to make the three big sets of if's into loops. Any suggestions or ideas on how they could be looped would be most welcome. Also, any ideas on why Netbeans is saying it compiles with errors when it does not give any. I'll give the code and then the output again.
    package d12;
    //import classes to use
    import java.util.Random;
    import java.util.Arrays;
    public class randomDice2D {
         * @param args the command line arguments
        public static void main(String[] args) {
    //bring in new Random object
            Random r = new Random();
    //declare all variables and arrays
            int[][] dieResults; dieResults = new int[6][6];
            int[] sortingResults; sortingResults=new int[36];
            int one; int two; int three; int four; int five; int six; int seven;
            int eight; int nine; int ten; int eleven; int twelve; int thirteen;
            int fourteen; int fifteen; int sixteen; int seventeen; int eighteen;
            int nineteen; int twenty; int twentyone; int twentytwo; int twentythree;
            int twentyfour; int twentyfive; int twentysix; int twentyseven;
            int twentyeight; int twentynine; int thirty; int thirtyone; int thirtytwo;
            int thirtythree; int thirtyfour; int thirtyfive; int thirtysix;
            //initialize all variables at 0
            one=0;two=0;three=0;four=0;five=0;six=0;seven=0;eight=0;nine=0;ten=0;
            eleven=0;twelve=0;thirteen=0;fourteen=0;fifteen=0;sixteen=0;seventeen=0;
            eighteen=0;nineteen=0;twenty=0;twentyone=0;twentytwo=0;twentythree=0;
            twentyfour=0;twentyfive=0;twentysix=0;twentyseven=0;twentyeight=0;
            twentynine=0;thirty=0;thirtyone=0;thirtytwo=0;thirtythree=0;thirtyfour=0;
            thirtyfive=0;thirtysix=0;
    //do dice rolling and count each iteration of each possible result - 36 possible??
            for (int i = 0; i < 36000; i++)
              int roll  = (r.nextInt(6) + 1) ;
              int roll2 = (r.nextInt(6) + 1) ;
            if (roll == 1 && roll2 == 1) ++one;
            if (roll == 1 && roll2 == 2) ++two;
            if (roll == 1 && roll2 == 3) ++three;
            if (roll == 1 && roll2 == 4) ++four;
            if (roll == 1 && roll2 == 5) ++five;
            if (roll == 1 && roll2 == 6) ++six;
            if (roll == 2 && roll2 == 1) ++seven;
            if (roll == 2 && roll2 == 2) ++eight;
            if (roll == 2 && roll2 == 3) ++nine;
            if (roll == 2 && roll2 == 4) ++ten;
            if (roll == 2 && roll2 == 5) ++eleven;
            if (roll == 2 && roll2 == 6) ++twelve;
            if (roll == 3 && roll2 == 1) ++thirteen;
            if (roll == 3 && roll2 == 2) ++fourteen;
            if (roll == 3 && roll2 == 3) ++fifteen;
            if (roll == 3 && roll2 == 4) ++sixteen;
            if (roll == 3 && roll2 == 5) ++seventeen;
            if (roll == 3 && roll2 == 6) ++eighteen;
            if (roll == 4 && roll2 == 1) ++nineteen;
            if (roll == 4 && roll2 == 2) ++twenty;
            if (roll == 4 && roll2 == 3) ++twentyone;
            if (roll == 4 && roll2 == 4) ++twentytwo;
            if (roll == 4 && roll2 == 5) ++twentythree;
            if (roll == 4 && roll2 == 6) ++twentyfour;
            if (roll == 5 && roll2 == 1) ++twentyfive;
            if (roll == 5 && roll2 == 2) ++twentysix;
            if (roll == 5 && roll2 == 3) ++twentyseven;
            if (roll == 5 && roll2 == 4) ++twentyeight;
            if (roll == 5 && roll2 == 5) ++twentynine;
            if (roll == 5 && roll2 == 6) ++thirty;
            if (roll == 6 && roll2 == 1) ++thirtyone;
            if (roll == 6 && roll2 == 2) ++thirtytwo;
            if (roll == 6 && roll2 == 3) ++thirtythree;
            if (roll == 6 && roll2 == 4) ++thirtyfour;
            if (roll == 6 && roll2 == 5) ++thirtyfive;
            if (roll == 6 && roll2 == 6) ++thirtysix;
            //assign results to array
            dieResults[0][0]=one;dieResults[1][0]=seven; dieResults[0][1]=two;
            dieResults[2][0]=thirteen;dieResults[0][2]=three;dieResults[3][0]=nineteen;
            dieResults[0][3]=four;dieResults[4][0]=twentyfive;dieResults[0][4]=five;
            dieResults[5][0]=thirtyone;dieResults[0][5]=six;dieResults[1][1]=eight;
            dieResults[2][1]=fourteen;dieResults[1][2]=nine;dieResults[3][1]=twenty;
            dieResults[1][3]=ten;dieResults[4][1]=twentysix;dieResults[1][4]=eleven;
            dieResults[5][1]=thirtytwo;dieResults[1][5]=twelve;dieResults[2][2]=fifteen;
            dieResults[3][2]=twentyone;dieResults[2][3]=sixteen;dieResults[4][2]=twentyseven;
            dieResults[2][4]=seventeen;dieResults[5][2]=thirtythree;dieResults[2][5]=eighteen;
            dieResults[3][3]=twentytwo;dieResults[4][3]=twentyeight;dieResults[3][4]=twentythree;
            dieResults[5][3]=thirtyfour;dieResults[3][5]=twentyfour;dieResults[4][4]=twentynine;
            dieResults[5][4]=thirtyfive;dieResults[4][5]=thirty;dieResults[5][5]=thirtysix;
            //print results
            System.out.println("     1      2      3      4     5      6");
            for (int j=0; j<dieResults.length; j++){
                System.out.print("\n"+(j+1)+" -");
                for (int k=0; k<dieResults.length; k++){
                System.out.print("|"+dieResults[j][k]+"| ");
            // Verify program accuracy to ensure total results add up to 36000
    System.out.println("\nAll total rolls add up to "+(dieResults[0][0]+dieResults[0][1]+
             dieResults[0][2]+dieResults[0][3]+dieResults[0][4]+dieResults[0][5]+
             dieResults[1][0]+dieResults[1][1]+dieResults[1][2]+dieResults[1][3]+
             dieResults[1][4]+dieResults[1][5]+dieResults[2][0]+dieResults[2][1]+
             dieResults[2][2]+dieResults[2][3]+dieResults[2][4]+dieResults[2][5]+
             dieResults[3][0]+dieResults[3][1]+dieResults[3][2]+dieResults[3][3]+
             dieResults[3][4]+dieResults[3][5]+dieResults[4][0]+dieResults[4][1]+
             dieResults[4][2]+dieResults[4][3]+dieResults[4][4]+dieResults[4][5]+
             dieResults[5][0]+dieResults[5][1]+dieResults[5][2]+dieResults[5][3]+
             dieResults[5][4]+dieResults[5][5]));
    //check lowest/highest numbers entered to verify results are reasonable
    //sort results to obtain lowest and highest number of rolls 
    int z;z=0;
    while (z < 36){
    for (int l=0; l<6;l++){
         for (int m=0; m<6;m++){
            sortingResults[z]=dieResults[l][m];++z;
    Arrays.sort(sortingResults);
    //determine and print what roll occurred the least
        if (sortingResults[0] == one)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1's with " + sortingResults[0]);
        if (sortingResults[0] == two)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == three)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == four)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == five)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == six)
            System.out.println("The lowest number of rolls for a single result is "
                    + "1 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == seven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == eight)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == nine)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == ten)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == eleven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == twelve)
            System.out.println("The lowest number of rolls for a single result is "
                    + "2 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == thirteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == fourteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == fifteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == sixteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == seventeen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == eighteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "3 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == nineteen)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == twenty)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == twentyone)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == twentytwo)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == twentythree)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == twentyfour)
            System.out.println("The lowest number of rolls for a single result is "
                    + "4 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == twentyfive)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == twentysix)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == twentyseven)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == twentyeight)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == twentynine)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == thirty)
            System.out.println("The lowest number of rolls for a single result is "
                    + "5 & 6 with " + sortingResults[0]);
        if (sortingResults[0] == thirtyone)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 1 with " + sortingResults[0]);
        if (sortingResults[0] == thirtytwo)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 2 with " + sortingResults[0]);
        if (sortingResults[0] == thirtythree)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 3 with " + sortingResults[0]);
        if (sortingResults[0] == thirtyfour)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 4 with " + sortingResults[0]);
        if (sortingResults[0] == thirtyfive)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 5 with " + sortingResults[0]);
        if (sortingResults[0] == thirtysix)
            System.out.println("The lowest number of rolls for a single result is "
                    + "6 & 6 with " + sortingResults[0]);
    //determine and print what roll occurred the most
        if (sortingResults[35] == one)
            System.out.println("The highest number of rolls for a single result is "
                    + "1's with " + sortingResults[35]);
        if (sortingResults[35] == two)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == three)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == four)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == five)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == six)
            System.out.println("The highest number of rolls for a single result is "
                    + "1 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == seven)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == eight)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == nine)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == ten)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == eleven)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == twelve)
            System.out.println("The highest number of rolls for a single result is "
                    + "2 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == thirteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == fourteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == fifteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == sixteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == seventeen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == eighteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "3 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == nineteen)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == twenty)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == twentyone)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == twentytwo)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == twentythree)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == twentyfour)
            System.out.println("The highest number of rolls for a single result is "
                    + "4 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == twentyfive)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == twentysix)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == twentyseven)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == twentyeight)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == twentynine)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == thirty)
            System.out.println("The highest number of rolls for a single result is "
                    + "5 & 6 with " + sortingResults[35]);
        if (sortingResults[35] == thirtyone)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 1 with " + sortingResults[35]);
        if (sortingResults[35] == thirtytwo)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 2 with " + sortingResults[35]);
        if (sortingResults[35] == thirtythree)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 3 with " + sortingResults[35]);
        if (sortingResults[35] == thirtyfour)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 4 with " + sortingResults[35]);
        if (sortingResults[35] == thirtyfive)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 5 with " + sortingResults[35]);
        if (sortingResults[35] == thirtysix)
            System.out.println("The highest number of rolls for a single result is "
                    + "6 & 6 with " + sortingResults[35]);
    }and here is the output (after clicking 'Run Anyways' on the project compiled with errors message from Netbeans)
    run:
         1      2      3      4     5      6
    1 -|995| |1014| |1076| |976| |1015| |1000|
    2 -|971| |982| |993| |1067| |983| |1011|
    3 -|990| |951| |1019| |968| |1011| |1023|
    4 -|999| |931| |1009| |987| |1020| |1022|
    5 -|969| |954| |997| |970| |1016| |1028|
    6 -|955| |1014| |996| |996| |1075| |1017|
    All total rolls add up to 36000
    The lowest number of rolls for a single result is 4 & 2 with 931
    The highest number of rolls for a single result is 1 & 3 with 1076
    BUILD SUCCESSFUL (total time: 13 seconds)

  • WS-Trust and WS-secure conversation auto-combined when both are enabled?

    In my app, client will have to obtain some authorization from a third party before it can consume the service provided by the server.
    Client - server interaction may span over several messages.
    As in WSIT, how is that implemented? with WS-Trust and WS-secure conversation, can I say that: client only need to be authorized once by third party (WS-Trust) in order to establish multiple transactions with server(secure conversation)?

    More precisely, the STS is the third party authority per ws-trust.
    The user first auththenticates to STS with its credentials (username/password, x509 certificate, etc). Then the STS issue an token (usually an SAML toekn)
    to the user for accessing the service. The the client present the issued token
    to the service to establish a security context (session) with the service per ws-secure conversation. This security context is used for securing the application messages.
    This process is transparent to the application with WSIT. You just need to do configurations with Netbeans to enable it.
    See WSIT tutorial for details:
    https://wsit-docs.dev.java.net/releases/m5/SecurityProfiles.html#wp113333

  • ABAP , JAVA And XSLT Mapping Doc's

    Hi,
    I am new to SAP XI Any body please send me the Doc's Related to ABAP, JAVA And XSLT Mappings. Thanks in Advance.
    Regards
    Kiran.B

    Hi
    Refer to
    ABAP mapping:
    How to Use ABAP Mapping in XI 3.0
    JAVA mapping:
    http://help.sap.com/saphelp_nw04/helpdata/en/bd/c91241c738f423e10000000a155106/frameset.htm (Java mapping)
    XSLT mapping:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
    /people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping
    /people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt
    /people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping
    XSLT Mapping with java enhancement
    /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners
    XSLT - /people/dirk.roeckmann/blog/2006/07/26/grouping-xml-with-xslt--from-muenchian-method-to-xslt-20
    Regards,
    Kumar.
    Reward points if helpful!!

  • BI Java and BI ABAP -RSPLAN issue

    Hi All
    We are working with BI system ,using BI 7.0 Java and BI ABAP as separate systems on same host.
    Already run the template intaller for BI Java and ABAP integration.
    But facing some issue ,when going ot BI ABAP and RSPLAN and clicking the Start Mideller
    it is opening a browser as http://host:8000/sap/public/myssocntl?sap-client-XXX
    Since this is not correct and it should open BI Java portal instead of ABAP stack page.
    Instead this should open a Url like this http://host:5XX00/webdynpro/dispatcher/sap.com/biplanworkbench1/Modeler?
    I check on BI ABAP system under SAP Reference IMG -> SAP Customizing Implementation Guide-> SAP NetWeaver _> Business Intelligence-> BI Integrated Planning -> Settings for Starting the Planning Modeler.
    There the default Url is BEx Portal Server and the url is        
    http://host:5XX00/webdynpro/dispatcher/sap.com/biplanworkbench1/Modeler
    Can anybody let me know why this is going to ABAP server instead it should go to Java.
    Regards
    Ajay
    Edited by: Ajay Sandal on Mar 10, 2009 2:31 PM

    Hi Ajay ..
    Good news that ur issue is resolved ..
    I have somewhat similar issue .. Hopu u can put some light ..
    I have Bi 7.o with Add on java  ,
    In RSPLAN from ABAP system , modular page is not coming . if i click on start moduler button in RSPLAN ..portal page is coming up and i have to give logging details .
    Please suggest .
    Thanks

  • Implicit and explicit Type conversion using Type object in heap

    Hi,
    I am surprised how Implicit and explicit Type conversion works using Type object in heap. for example when implicit type conversion occur what pointer it returns to object and similarly with explicit type conversion.

    Hello,
    >> I am surprised how Implicit and explicit Type conversion works using Type object in heap.
    For Implicit conversions: Typical examples are conversions from smaller to larger integral types, and conversions from derived classes to base classes. For the first one, the reference would be different which means it would return a different pointer to
    a new object. For the reference type, it actually points to the same memory location, you could use the object.ReferenceEquals() to check it.
    For Explicit conversions (casts):Typical examples include numeric conversion to a type that has less precision or a smaller range, and conversion of a base-class instance to a derived class. For first one, it would perform the same with implicit conversions.
    While for the conversion of conversion of a base-class instance to a derived class, actually, there's no built-in way to do this conversion.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to get return value from java and read by other application?

    i want to read return value from java and the other application read it.
    for example:
    public class test_return {
        test_return(){
        public int check(){
            return 1;
        public static void main(String args[]){
           new test_return().check();
    }from that class i make as jar file. How to read the return value (1) by other application?
    thx..

    If your installer is requiring some process it invokes to return a particular value on failure, then the installer is seriously broken. There are a bazillion commands your installer could invoke, and any of them could fail, which in turn could invalidate the entire install process, and any of them could return any value on failure. The only value that's consistent (in my experience) is that zero means success and non-zero means failure, with specific non-zero values being different in different programs.
    About the only control you have over the JVM's exit code is that if your main method completes without throwing an exception, the JVM will have an exit code of 0, and if main throws an exception (either explicitly or by not catching one thrown from below), it will be non-zero. I'm not even sure if that's guaranteed, but I would guess that's the case.
    EDIT: I'm kind of full of crap here. If you're writing the Java code, you can call System.exit(whatever). But nonetheless, if your installer requires certain exit codes from any app--java or otherwise--you have a problem.
    Edited by: jverd on Oct 29, 2009 1:27 AM

  • Problem with java and flex web service

    Hi,
    I have a basic web service written in java using jax ws 2.1
    ri. I need to call it from Flex using the WebService class
    Annotations for the java web method :
    @WebMethod
    public void Login(
    @WebParam(name="server") String serverURL,
    @WebParam(name=AUTHENTICATE_HEADER,header=true,mode=WebParam.Mode.INOUTHolder<Authenticate Header>
    authHeader)
    When I try and call the service from Flex , it can't find the
    login method and attempts to call it fail. If I set the web service
    to RPC based using @SOAPBinding , the method is found but then
    there are issues with the authentication header.
    What do I need to do to get flex web services communicating
    succesfully with java ?
    Are there are any known compatibility issues ? Or guidelines
    for going about this ?
    Any help would be appreciated

    well Shay,
    i've used JDev's tools to developer and to deploy the web service: the war and ear files are automatically generates you to the end of the process.
    I have included all the files java and the compiled classes, but I do not have files jar.
    But don't works: if i create only one java class with all code inside then it works fine!!
    Daniele

  • Problem with java and javaw

    Hi,
    In running the following simple code, I have gotten different results using java and javaw.
    public class Test {
    public Test() {
    public static void main(String[] args) {
    int x =4;
    System.out.println("The value is "+ ((x > 5)?6.0:4));
    System.out.println("The value is "+ ((false)?6.0:4));
    System.out.println("The value is "+ ((true)?99:9.9));
    Using java, I get the following results:
    The value is 4.0
    The value is 4.0
    The value is 99.0
    But using javaw, I get the following results:
    The value is 4.0
    The value is 4
    The value is 99
    Any ideas why this is so?
    Thanks for any help.
    Gilbert

    I used JBuilder to run the following code and Jbuilder uses javaw.
    By the way, the correct answer is the one using java right?

  • Problem with Java and Zip Files

    Hello there everyone. I have a problem with trying to zip up directories with empty folders in them. They zip fine with my code, but according to winzip, the number of files in the archive is incorrect. It's supposed to have a total of 288 files in it, but when it's zipped up, it only says 284. I mention specifically the "empty directories" note because the zipping works fine without empty folders.
    Below is the code for the zip method:
    public static void zip(File[] list, File zipfile, File zipRoot)
         throws IOException {
          if (!zipfile.exists()) {
                   zipfile.createNewFile();
              else if (!zipfile.isFile()) {
                   throw new IOException("The zip file, " + zipfile.getAbsolutePath()
                             + " is not a file.");
              if (list.length == 0) {
                  LOG.error("The list of files to zip up is empty.");
              for (int i = 0; i < list.length; i++) {
                   if (!list.exists()) {
                        throw new IOException("The file or directory, " + list[i].getAbsolutePath()
                                  + " does not exist.");
              FileOutputStream fos = new FileOutputStream(zipfile);
              ZipOutputStream zos = new ZipOutputStream(fos);
              for (int i = 0; i < list.length; i++) {
                   if (LOG.isDebugEnabled())
                        LOG.debug(i + ": " + list[i].getName());
                   String entryName = getRelativeName(list[i], zipRoot);
                   if (list[i].isDirectory()){
                        if (list[i].listFiles().length == 0){
                             ZipEntry entry = new ZipEntry(entryName + "/");
                             zos.putNextEntry(entry);
                   else {
                        ZipEntry ze = new ZipEntry(entryName);
                        zos.putNextEntry(ze);
                        byte[] buffer = new byte[8096];
                        FileInputStream fis = new FileInputStream(list[i]);
                        int read = 0;
                        read = fis.read(buffer);
                        if (LOG.isDebugEnabled())
                        LOG.debug("\tFound " + read + " bytes.");
                        if (read == -1){
                             //empty file, but add it for preservation.
                             //zos.write(buffer,0,0);
                        while (read != -1) {
                             zos.write(buffer, 0, read);
                             read = fis.read(buffer);
                        fis.close();
                        zos.closeEntry();
              zos.close();
    The files look like they're there, but I need the system to be able to determine the number correctly. 
    Here's the interesting thing:  It zips the files, and then when I use the size() method for zip files in java, it says 284 files.  But when I unzip, it says 288 again.  It's like there's files missing when compressed, but when decompressed, they return.  Note that the files are actually there.  If I open the archive in a third party app such as Winzip AND Winrar AND IZarc, they all show 288 files.  Any idea what would make the number of files appear incorrectly in a zip file when zipped by java with the code above?  Thanks in advance.
    - Chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I figured out the problem. When zipping files in windows using winzip, it doesn't explicitly count folders as a "file/folder" as a file in itself. It will create the folders for files to go in, but the folder itself will not be 'counted' when you query the info of the file itself. You have more control of the zip file in java, and can count the folder as a file or not.

Maybe you are looking for