Advertisement
jaVer404

level09.lesson11.home07

Apr 26th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. package com.javarush.test.level09.lesson11.home07;
  2.  
  3. /* Расставь модификаторы static
  4. Расставь модификаторы static так, чтобы пример скомпилировался.
  5. */
  6.  
  7. public class Solution
  8. {
  9.     public static int  A = 5;
  10.     public static int B = 2 * A;
  11.     public int C = A * B;
  12.     public static int  D = A * B;
  13.  
  14.     public void main(String[] args)
  15.     {
  16.         Solution room = new Solution();//cоздаем обьект класа Solution  у которго есть поле А
  17.         room.A = 5;
  18.  
  19.         Solution.D = 5;
  20.     }
  21.  
  22.     public int getA()
  23.     {
  24.         return A;
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement