Skip to main content

Posts

Showing posts with the label how to create java package and use it

how to create java package and use it

java creating simple package containing class and display method in another program accessing that package using import keyword video tutorial A   package  is a collection of related classes. it helps improve   re-usability. It helps   Organize  your classes into a folder structure and make it easy to locate and use them. Syntax used to create package is  package;   Step 1)   Consider the following code, ·        Save as demo.java ·        Compile using javac demo.java ·        Re comple ·        javac -d . demo.java ·        Packge name folder created ·         Java p1.c1 fully qulified name is used to run mehtod  package p1; class c1{ public void m1() { System.out.println("pakge class "); } ...

Labels

Show more