zoukankan      html  css  js  c++  java
  • 《JAVA 核心技术 基础知识》 第十章 笔记


    应用程序首选项存储


    属性映射:


    保存至文件中

    Properties settins=new Properties();
    		settins.put("name","good");
    		FileOutputStream fout=null;
    		try {
    			fout = new FileOutputStream("setting.properties");
    			settins.store(fout, "this is a command");
    			fout.close();
    		} 
    		catch (FileNotFoundException e) {e.printStackTrace();}
    		catch (IOException e) {e.printStackTrace();}

    从文件中读取

    	FileInputStream fin=null;
    		try {
    			fin=new FileInputStream("setting.properties");
    			settins.load(fin);
    			String name=settins.getProperty("name","default");
    			System.out.println("name:"+name);
    		} 
    		catch (FileNotFoundException e) {e.printStackTrace();}
    		catch (IOException e){e.printStackTrace();}


    JAR 文件:

        暂无。跳过ing。。

    Java Web Strart:

         暂无。跳过阅读ing。。。

    Applet:

       同楼上

    版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 相关阅读:
    kubernetes之secret
    kubernetes的核心组件功能
    ingress
    服务发现: coredns
    service
    deployment控制pod进行滚动更新以及回滚
    init container
    service与pod关联
    Joiner
    SpringMVC 用注解Annotation驱动的IoC功能@Autowired @Component
  • 原文地址:https://www.cnblogs.com/Thereisnospon/p/4771099.html
Copyright © 2011-2022 走看看