package pack1;
public class Student
{
public int rol_no=18;
public char name[]={‘s’,’e’,’k’,’h’,’a’,’r’};
}
package pack2;
public interface Sports
{
void show();
}
//Program to implement packages
package Record;
import pack1.*;
import pack2.*;
class sports1 implements Sports
{
public void show()
{
System.out.println(“21/3/2011 – volley ball”);
System.out.println(“22/3/2011 – Cricket”);
System.out.println(“23/3/2011 – Table tennis”);
}
}
class Report
{
public static void main(String args[])
{
Student s=new Student();
sports1 s1=new sports1();
System.out.print(“Rollnumber: “+s.rol_no+”nname “);
System.out.println(s.name);
s1.show();
}
}
Output:
Rollnumber: 18
name sekhar