1 Java Foundation Enhancements

Source: Internet
Author: User

1.JDK built -in annotations

2.classpath File parsing

通过Eclipse创建的每个项目中都有一个 .classpath文件       src:源目录 存放代码和配置文件       output :  项目的根路径classpath路径,源目录的代码和配置文件都会编译到此目录下       con:     引入eclipse自带环境  jre       lib:    引入第三方jar包

3. Load the configuration file

 ClassLoader,每一个项目中有且只有一个ClassLoader,在项目运行时候JVM自动就为当前项目创建一个ClassLoader。        类加载器可以从项目的根路径下面加载对应的资源文件    / 方式1 :从当前线程中去获取   //ClassLoader classLoader = Thread.currentThread().getContextClassLoader();    //方式2 :通过当前类的字节码获取    ClassLoader classLoader =当前类名.class.getClassLoader();    //读取配置文件    InputStream inputStream=classLoader.getResourceAsStream(fileName);    Properties p=new Properties();    p.load(inputStream);    p.getProperty("");

4.javaBean

       符合规范的类:          1.类的修饰符必须是public            2.必须有无参数构造器(用于反射创建对象)            3.javaBean必须向外暴露get/set方法来确定javaBean的属性

1 Java Foundation Enhancements

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.