Exercise 1: (1) Create a class in a package that creates an instance of the class outside the package where the class is located.
Import Mil.oms.main.test.Test; Public class maintest {public static void Main (String args[]) { Test test=new test (); } /** Run result test () instantiation ...
Package Mil.oms.main.test;public class Test{public Test () {System.out.println ("Test () instantiation ...");}
Exercise 2: (1) rewrite the code snippet in this section as a complete program, and verify the actual conflicts that occurred.
Import mil.oms.main.test.vector;import java.util.*;p ublic class maintest {public static void main ( String args[]) { vector vector=new vector (); Java.util.Vector vector1=new java.util.Vector (); }}
Package Mil.oms.main.test;public class Vector{public vector () {System.out.println ("vector () instantiation ...");}
Java Programming Ideas Fourth edition sixth chapter personal practice