To use a public package member class interface from

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ackages n༆  Only public package members are accessible outside the package in which they are defined. To use a public package member (class, interface) from outside its package, you must either: q༇  Refer to the member by its long (disambiguated) name. n༆  q༇  Shape.java package shapes; public abstract class Shape { int x,y; public Shape(int x, int y){ this.x = x; this.y = y; } } n༆  n༆  put the package statement in all the Java files you intend to include in your package. needs to be the first statement in the file (except for comments) A package defines a namespace If you do not use a package statement, your class or interface ends up in the default package, which is a package that has no name. Package naming n༆  Package naming conv...
View Full Document

This note was uploaded on 02/10/2014 for the course CS 161 taught by Professor Boese during the Spring '08 term at Colorado State.

Ask a homework question - tutors are online