Ask for help( simple code but wired error )!

The post I sent just now has some mistakes. This post is correct. My simple code is as follows:
import java.io.*;
import java.net.*;
public class count {
float dclient = (float)3.333;
float dlan = (float)0.01884;
float drouter = (float)0.00115;
float doutlink = (float)0.04185;
float dinternet = (float)1.2615;
float dinlink = (float)3.18129;
float client1 = 0;
float lan1 = 0;
float router1 = 0;
float outlink1 = 0;
float internet1 = 0;
float inlink1 = 0;
float client2 = 0;
float lan2 = 0;
float router2 = 0;
float outlink2 = 0;
float internet2 = 0;
float inlink2 = 0;
float x = 0;
float z = (float)3.333;
public static void main(String[] args) {
for (int n=1; n<16; ++n)
client1 = dclient;
lan1 = dlan * (1+lan2);
router1 = drouter;
outlink1 = doutlink * (1+outlink2);
internet1 = dinternet;
inlink1 = dinlink * (1+inlink2);
x = n / (z + client1 + lan1 + router1 + outlink1 + internet1 + inlink1);
client2 = x * client1;
lan2 = x * lan1;
rounter2 = x * rounter1;
outlink2 = x * outlink1;
internet2 = x * internet1;
inlink2 = x * inlink1;
System.out.println(client1 + " " +
lan1 + " " +
rounter1 + " " +
outlink1 + " " +
internet1+ " " +
inlink1+ " **** " +
x + " **** " +
client2 + " " +
lan2 + " " +
rounter2 + " " +
outlink2 + " " +
internet2+ " " +
inlink2 + " ********************end of n = " + n + "************************"
The compiling error is:
count.java:43: Can't make a static reference to nonstatic variable dclient in class count.
client1 = dclient;
^
1 error
What is wrong with it? Many thanks!

import java.io.*;
import java.net.*;
public class count
     public static float dclient = (float)3.333;
     public static float dlan = (float)0.01884;
     public static float drouter = (float)0.00115;
     public static float doutlink = (float)0.04185;
     public static float dinternet = (float)1.2615;
     public static float dinlink = (float)3.18129;
     public static float client1 = 0;
     public static float lan1 = 0;
     public static float router1 = 0;
     public static float outlink1 = 0;
     public static float internet1 = 0;
     public static float inlink1 = 0;
     public static float client2 = 0;
     public static float lan2 = 0;
     public static float router2 = 0;
     public static float outlink2 = 0;
     public static float internet2 = 0;
     public static float inlink2 = 0;
     public static float x = 0;
     public static float z = (float)3.333;
     public static void main(String[] args)
          for (int n=1; n<16; ++n)
               client1 = dclient;
               lan1 = dlan * (1+lan2);
               router1 = drouter;
               outlink1 = doutlink * (1+outlink2);
               internet1 = dinternet;
               inlink1 = dinlink * (1+inlink2);
               x = n / (z + client1 + lan1 + router1 + outlink1 + internet1 + inlink1);
               client2 = x * client1;
               lan2 = x * lan1;
               router2 = x * router1;
               outlink2 = x * outlink1;
               internet2 = x * internet1;
               inlink2 = x * inlink1;
               System.out.println(client1 + " " +     lan1 + " " router1 " " outlink1 " " internet1 " " inlink1 " **** " +     x + " **** " +
               client2 + " " +
               lan2 + " " +
               router2 + " " +
               outlink2 + " " +
               internet2+ " " +
               inlink2 + " ********************end of n = " + n + "************************"

Similar Messages

Maybe you are looking for

  • HOW TO RECOVER A LOST FOLDER OR FILES?

    I have had severe problems with my Macbook lately and I'm scared I have lost a very important folder and some files. How can I find them or recover them completely? I have searched the trash, spotlight, and finder and its missing???! please help than

  • WD external harddisk not recognised after failed format

    Hi folks, So I have an old WD 320GB harddisk I pulled from an old windows acer 5535 I wasn't using, I tried formatting it to OSX journaled so i could use it to back my friends mac up. The drive was initially readable and showed my windows 7 and files

  • Please help me to delete pending download files

    Hi, I would like to delete pending downloads in my itunes.

  • Form initialisation problem QMS-00100

    I am NOT succeeding in generating a form with the right pre-form tigger code: The following code should be in the PRE-FORM trigger: /* CGNV$PRE_FORM_NAVCUR */ DECLARE rg_id RECORDGROUP; gc_wnd GROUPCOLUMN; gc_item GROUPCOLUMN; BEGIN CGNV$.nav_opening

  • How can I delete older apple ID on app store?

    I have bought a second-hand macbook pro, the old owner removed his account and created a new one for me. I did a clean new install of OS and added my appl ID, but app store doesn' allow to update apps. when it asks to insert my ID the space for the u