












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Interfaces:
Interfaces have the following properties
Difference between abstract classes and Interfaces:
**Nested Interfaces: *** An interface can be declared a member of a class or another interface.
Encapsulation:
public class emp { private String name; private int age; public void setAge(int newAge) { age=newAge; } public int getAge() { return age; } public void setName(String newName) { name=newName; } public int getName() { return name; }
Java packages are classified into two types:
Using System Packages: There are two ways of accessing the classes stored in a package.
Steps for creating package:
package newpackage; import static pak1.NewClass1.a; public class NewClass { public static void main(String [] arg){ System.out.println(a); } }
package newpackage; import static pak1.NewClass1.m; public class NewClass { public static void main(String [] arg){ m(); } }