Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
import problem
Bob CHOI
Ranch Hand
Posts: 127
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
/*
Why did i get compilation error on code below? Thanks!
java
:1: require '.'
import A;
*/
import A; class A {}
[ December 12, 2006: Message edited by: Bob CHOI ]
[ December 12, 2006: Message edited by: Bob CHOI ]
Hard work rewards
Keith Lynn
Ranch Hand
Posts: 2412
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What are you trying to do?
Bob CHOI
Ranch Hand
Posts: 127
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i tried to code something below, but failed on the "import statement"...
import static A.*; enum A {A_1,A_2} class B { A a = A_1; }
Hard work rewards
Keith Lynn
Ranch Hand
Posts: 2412
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Do you have a class named A.java?
Bob CHOI
Ranch Hand
Posts: 127
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
if put them into non default package, then it works! ???
package p; import p.A; class A {}
Hard work rewards
Keith Lynn
Ranch Hand
Posts: 2412
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'm still not clear on what you are trying to do. You cannot import classes in the default package.
Wiyanto Ngasinur
Ranch Hand
Posts: 34
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
are you trying to import class A that have the same package,
if it's so, that code wont work i think.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Array Conversion
Important items for taking SCJP 5.0 exam on the day
What underflow and overflow occures?
customized object deserialization method
SCJP100
More...