votako

pac acss

Dec 6th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1. A+B = in main dir. "/"
  2. C+D = in package net. "/net"
  3. ----------------------------
  4. class A
  5. -------
  6. import static net.Print.*;
  7. import net.*;
  8.  
  9. public class Test{
  10.     public static void main(String[] args) {
  11.         Nothing noth = new Nothing();
  12.         noth.ineger();
  13.         noth.stri();
  14.     }
  15. }
  16. -------------------------------------------------
  17. class B
  18. -------
  19. import static net.Print.*;
  20.  
  21. class Some{
  22.     int i=5;
  23.     String s="qweqwe";
  24.     private void num(){
  25.         print(i);
  26.     }
  27.     String str(){
  28.         print(s);
  29.         return s;
  30.     }
  31. }
  32.  
  33. class SomeElse extends Some{
  34.     void num(){
  35.         i++;
  36.         print(i);
  37.     }
  38. }
  39. -------------------------------------------------
  40. -------------------------------------------------
  41.  
  42.  
  43. class C
  44. -------
  45. package net;
  46.  
  47. public class Print {
  48.   // Print with a newline:
  49.   public static void print(Object obj) {
  50.     System.out.println(obj);
  51.   }
  52. }
  53. -------------------------------------------------
  54. class D
  55. -------
  56. package net;
  57. import static net.Print.*;
  58.  
  59. public class Nothing{
  60.     int i=7;
  61.     String s="asdzxc";
  62.     protected int ineger(){
  63.         i++;
  64.         print(i);
  65.         return i;
  66.     }
  67.     private String stri(){
  68.         print(s);
  69.         return s;
  70.     }
  71. }
  72. -------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment