Link to complete Java tutorial with VoiceOver - http://bit.ly/1muxuWW
Here is the java program I used
// Program to create a package
import alpha.*;
class Package
{
public static void main(String args[])
{
classA a = new classA();
a.displayA();
classB b = new classB();
b.displayB();
}
}
// Codes for individual classes inside the alpha folder package
// the .class file of these classes must be placed inside the alpha folder
// for classA
package alpha;
public class classA
{
public void displayA()
{
System.out.println("This is classA.");
}
}
// for classB
package alpha;
public class classB
{
public void displayB()
{
System.out.println("This is classB.");
}
}
After opening command prompt, firstly we need to set the path of bin java directory, done by
set path="bin path here"
Then we change directory to where our program is located, by
cd JavaProgramPathHere
Then we have to compile classA and classB and put their .class files in a folder named alpha
We run
javac -d . classA.java classB.java
A new folder named alpha is created, and class file is directly sent there.
Now all we need to do is compile the main program, Package.java
Delete classA.java and classB.java if it throws up some errors.
Compile using javac Package.java
Run using java Package
Thats it guys..!
Refer the youtube video to know more and learn how to execute exactly :D
Link to full video course with voiceover - http://bit.ly/1muxuWW
On this page of the site you can watch the video online Java packages executed- How to import other java programs in a main program with a duration of hours minute second in good quality, which was uploaded by the user Themultiomniman 30 October 2014, share the link with friends and acquaintances, this video has already been watched 23,242 times on youtube and it was liked by 53 viewers. Enjoy your viewing!