Passing Variables between methods?

前端 未结 5 1813
情书的邮戳
情书的邮戳 2021-01-17 00:10

So im trying to write a simple java program for college and I\'m a complete newbie at this java stuff. I keep getting an error when I compile, \"error - could not find symbo

5条回答
  •  爱一瞬间的悲伤
    2021-01-17 00:43

    You can add the variables making them static .

        public class Order {
    
        static String clubcard;
        static double clubcard_discount;
       static  double special_discount;
      static   double balance; 
      static   double final_balance; 
      static   int apples;
       static  int oranges;
       static  int apples_cost;
       static  int oranges_cost;
    
     public static void main (String[] args) { ...
    

    Try this and let us know.

提交回复
热议问题