Groups

    Anybody good at java in netbeans? want to do their good deed of the day?

    Basically this will only make sense to people who know about java.. Right first off here is my problem, these two pieces of code are in the same project but different file pages, the problem that i have is i want to get the number in snum1 from thecode at the top to the one in the other file ( i thought the extends Raw_material line would be enough) any help would be grand;

    The superclass:
    package dicegame;
    import java.util.Random;

    public class Raw_material{

    public static void main(String[] args)throws Exception {

    int swip1,snum1,ewip1,number1;

    swip1 = 1000;

    Random dice = new Random();
    for(int counter=0; counter number1 =1+dice.nextInt(6);

    ewip1=swip1 - number1;
    snum1=number1;


    package dicegame;
    import java.util.Random;

    public class Main extends Raw_material{ //Extends due to Raw material being super class

    public static void main(String[] args)throws Exception { //workstation 2

    int swip,snum,ewip,number;

    swip= 4;

    Random dice = new Random();
    for(int counter=0; counter number =1+dice.nextInt(6);
    //Creates the random number of counters to pass

    snum = number; //send counters = dice roll
    ewip =swip-number+snum1; // End work in progress is calculated

    Post a comment
    Avatar
    @
      Text
      Top Discussions
      1. Just heard this...2 ★★★★★★★★★★★★★★ congrats to all on 392k ★★★★★★★★★★★★★★7767254
      2. 75% off Sky TV for existing customers. Only works when you call the specifi…17826370
      3. Lets hope that there are as few injuries as possible - Parson's Green40214
      4. Quidco and new IPAD 'Prevent Cross-Site Tracking'11

      See more discussions