Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Import Ques.

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a class file in the following package:
pkgA/p1/pack.class
(A)
import pkgA.p1.pack;
class testPkg {
public static void main (String args[]){
pack test=new pack();
}//end main
}//end class
(B)
import pkgA.p1.*;
class testPkg {
public static void main (String args[]){
pack test=new pack();
}//end main
}//end class
(A) compiles successfully, (B) gives compile error " cannot resolve symbol ".
Can you please explain why (B) is giving error ? What is wrong with the import statement ?
thanks.
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bhaswati,
What compiler are you using? I am using JDK1.2 and the following works for me.
packages/utils/C.class
(A.java)

(B.java)

Regards,
Manfred.
 
Bhaswati Karmakar
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thnaks for your response. I am using JDK 1.3
 
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic