| Author |
Using Java Bean compiled without a package
|
Salvador Cecilio
Ranch Hand
Joined: Dec 20, 2004
Posts: 41
|
|
I've been able to create and use java beans only if they are part of a package. I'm reading the SCWCD Exam Book by Manning Publishing and their example code doesn't work on my machine (Tomcat Standalone 4.1.31). Specifically the example of usage of Java Beans in Chapter 14 (pages 251-252). The following code causes an error: The AddressBean.java file is as follows: I can get the java bean to work if I compiled it as part of a package and use the import statement. Is it possible for a java bean to be compiled without a designation to a package and still be used?
|
SCJP 1.4 - 93%
SCWCD 1.4 - 89%
IBM FileNet 3.5 - Developer
IBM FileNet 3.5 - Administrator
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
|
No, I don't think this would work. Anyway, putting everything into packages is good practice, so you should stick to it.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Peter Sin
Ranch Hand
Joined: Jan 13, 2005
Posts: 547
|
|
|
Java bean can't be placed without package.
|
 |
 |
|
|
subject: Using Java Bean compiled without a package
|
|
|