JavaBean问题?
PHP中文网
PHP中文网 2017-04-17 17:55:23
0
3
736

下列关于JavaBean的说法正确的是:( )
A Java文件与Bean所定义的类名可以不同,但一定要注意区分字母的大小写
B 在JSP文件中引用Bean,其实就是用<jsp:useBean>语句
C 被引用的Bean文件的文件名后缀为.java
D Bean文件放在任何目录下都可以被引用

A是什么意思?
B为什么错了?

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
小葫芦

A Bean is essentially a java class, so the public class name and file name must be the same
B <jsp:useBean> declares a bean, not a reference, see the description here
C Yes, a bean is a type of java class , the file name suffix of the java class is java
D Any is definitely wrong. If you put it on someone else’s computer, you can’t quote it, at least not directly

伊谢尔伦

This kind of question is really boring. It's either wordy or vague. I guess the person who asked the question is also half-assed.

  1. What is the class name defined by Bean? Can Bean define a class?

  2. It seems to be correct, but the premise is that the corresponding java class must be in the class path, but does this have anything to do with java beans?

  3. The file suffix is ​​just an appearance. What if I change .class to .java and then use classLoader to load the file?

  4. If I write a custom ClassLoader and scan all directories, won’t the beans be loaded in? What is referencing a bean file?

迷茫

Don’t worry too much when you encounter a question with unclear language. The person who asked the question didn’t even understand it himself...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!