This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile with the package statement

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I have 2 questions.
1) How to compile a program with the package statement. I mean when the file is compiled it should go to the correct folder specified by the package decleration.
2)
package abc;
class Cl1 {
}
package xyz;
import abc.*;
class Cl2 extends Cl2{
}

If the Cl1 class is not compiled, if you compile the Cl2 java file does it give compiler error saying Cl1 was not compiled or can not find Cl1? or does it compile the base class as well?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic