Anybody good at java in netbeans? want to do their good deed of the day? - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

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

winifer Avatar
6y, 11m agoPosted 6 years, 11 months ago
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<1;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<1;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
Tags:
winifer Avatar
6y, 11m agoPosted 6 years, 11 months ago
Options

All Comments

(0) Jump to unreadPost a comment
Comments/page:

No comments yet.

Be the first, enter your comment below.

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!