Advertisement
Shailrshah

Making a Simple Package

Oct 30th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. package test;
  2. public class InTest{
  3.     public InTest(){}
  4.     public void hello(){
  5.         System.out.println("Hello World!");
  6.     }
  7. }
  8. //Compile and save the .java and .class files in /bin/test
  9.  
  10. import test.*;
  11. class PackageTest{
  12.     public static void main(String[] args){
  13.         InTest obj = new InTest();
  14.         obj.hello();
  15.     }
  16. }
  17. //Compile and save in bin, execute PackageTest.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement