Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A+B = in main dir. "/"
- C+D = in package net. "/net"
- ----------------------------
- class A
- -------
- import static net.Print.*;
- import net.*;
- public class Test{
- public static void main(String[] args) {
- Nothing noth = new Nothing();
- noth.ineger();
- noth.stri();
- }
- }
- -------------------------------------------------
- class B
- -------
- import static net.Print.*;
- class Some{
- int i=5;
- String s="qweqwe";
- private void num(){
- print(i);
- }
- String str(){
- print(s);
- return s;
- }
- }
- class SomeElse extends Some{
- void num(){
- i++;
- print(i);
- }
- }
- -------------------------------------------------
- -------------------------------------------------
- class C
- -------
- package net;
- public class Print {
- // Print with a newline:
- public static void print(Object obj) {
- System.out.println(obj);
- }
- }
- -------------------------------------------------
- class D
- -------
- package net;
- import static net.Print.*;
- public class Nothing{
- int i=7;
- String s="asdzxc";
- protected int ineger(){
- i++;
- print(i);
- return i;
- }
- private String stri(){
- print(s);
- return s;
- }
- }
- -------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment