calling a class from another package
calling a class from another package
Collapse
X
-
try this code for call a class from another package
new package
calling a class in another packageCode:package people; class Children{ private String name; public Children( ) { name = "Unknown"; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
Code:package test; import people.Children; public class Test { public static void main(String[] args) { Children children= new Children(); //declare and initialize } }
Comment