
Java
有限制
这个作者很懒,什么都没留下…
展开
-
java String字符串的内存地址
int hello = System.identityHashCode("hello");System.out.println(hello);hello = System.identityHashCode("hello");System.out.println(hello);hello = System.identityHashCode(new String("hello"));Syst...原创 2020-02-13 10:51:14 · 5774 阅读 · 2 评论 -
springboot 获取jar包所在目录
springboot 获取jar包所在目录 /** * 如果已打成jar包,则返回jar包所在目录 * 如果未打成jar,则返回target所在目录 * @return */ public static String getRootPath() throws UnsupportedEncodingException { // ...原创 2020-02-05 20:30:13 · 4278 阅读 · 0 评论 -
Java web 项目的域名
import javax.servlet.http.HttpServletRequest;动态获取域名: @RequestMapping("/7") public Object t7(HttpServletRequest request) { String s = request.getRequestURL().toString(); Syste...原创 2019-12-20 17:50:30 · 534 阅读 · 0 评论 -
Java项目路径打包后的路径输出变动
Java代码:URL url = this.getClass().getResource("/");System.out.println("URL: " + url.toString());System.out.println("URL: " + url.toString());System.out.println("getFile:" + url.getFile());System.o...原创 2019-11-20 19:12:06 · 1051 阅读 · 0 评论