You are here: Home / Topics / Creating package example in Java

Creating package example in Java

Filed under: Java on 2023-09-17 13:20:18

// Program to explain Creating Package.

package  Pack1;

class First
{
public void view( )
{
 System.out.println( "This is First Class." );
}
}

public class  ImportPack2
{
public static void main( String args[ ] )
{
 First f = new First();
 f.view();
}
}

 

Output:

This is First Class.

About Author:
S
Shyam Dubey     View Profile
I am a good learner. I like posting new questions on this plateform to help other students.