Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Package level constructor ?

 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a simple javabean class:-
package a.b.c;
public class Foo{
int i;
Foo(){ i = 1000; }
void setI(int i){ this.i = i; }
int getI() { return(i); }
}
And in a servlet; it failed to load the class Foo
via a:
Class.forName( a.b.c.Foo );
I don't understand what the package level access modifier
does to a class constructor. Note that I am able to instantiate
the class Foo like this:
Foo f = new Foo();
Pho
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pho,
There is not quite enough information here for us to follow. Where does the directory reside - client side or server side?
What is the code that didn't work?? What was the error given?
I'm afraid that it SOUNDS like you have the package on the client side with the GUI, and are trying to access it from the server side (Nope won't work). This of course had nothing to do with constructors, just architecture.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic