zoukankan      html  css  js  c++  java
  • [转]InputStream in = this.getClass().getResourceAsStream("photo.gif")的意思

    方法getResourceAsStream()是一个标准方法,用来打开一个外部输入文件。文件的位置取决于类加载器,而标准的类加载器从classpath开始搜索
    如:c:/temp/mytest/Test.class

      package   mytest;  
      public   class   Test{...}  
       
      Test.class.getResourceAsStream(str);  
       
      str="/db.properties"   则   db.properties   放在   c:/temp下  
      str="db.properties"   则   db.properties   放在c:/temp/mytest下
  • 相关阅读:
    RaisedButton
    Icon
    RichText
    GridView
    HTML常用标签
    HTML语法
    HTML简史
    17_继承
    16_Math
    16_ArrayList
  • 原文地址:https://www.cnblogs.com/encode/p/5825900.html
Copyright © 2011-2022 走看看