![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Java
yexianyi
Software Architect @ Siemens
Email: yexianyi@hotmail.com
Linkedin: http://cn.linkedin.com/in/yexianyi/
Github: https://github.com/yexianyi/
展开
-
从指定的字符串中提取Email
从指定的字符串中提取Email package net.util.email;import java.util.regex.Matcher;import java.util.regex.Pattern;public class EmailUtil { /** * 从指定的字符串中提取Email content 指定的字符串原创 2008-09-21 10:53:00 · 1907 阅读 · 0 评论 -
How to handle various of Out Of Memory Issues
Different Out Of Memory Issues* Exception in thread “CompilerThread1″ java.lang.OutOfMemoryError: requested 793020 bytes for Chunk::new. Out of swap space?Out of memory while reading in symbol t转载 2013-03-29 10:16:16 · 1100 阅读 · 0 评论 -
About Concurrent Modification Exception
About Concurrent Modification ExceptionThis exception is not necessarily thrown in a multithreaded code. It happens when you modify a collection while it is being iterated. You can get this exceptio转载 2013-04-18 10:49:53 · 1463 阅读 · 1 评论 -
Java Dynamic Proxy: How to know what exception cause java.lang.reflect.InvocationTargetException?
Issue:When we use Java Dynamic Proxy, method.invoke() is a necessary step to call the real method we want. But once this method triggers an exception during execution, the final exception printed ou原创 2013-01-16 10:51:55 · 877 阅读 · 0 评论 -
Java: How to resolve Access Restriction error
Issue:Access restriction: The constructor 'BASE64Decoder()' is not API (restriction on required library...) Solution:Go to the Build Path settings in the project properties.Remove the JRE Sy原创 2015-02-12 14:51:41 · 707 阅读 · 0 评论 -
The packages can be overrided by Java Endorsed Standards
Endorsed Standards APIsThe Endorsed Standards for Java SE constitute all classes and interfaces that are defined in the packages listed in this section. Classes and interfaces defined in sub-pac转载 2015-04-14 14:46:32 · 689 阅读 · 0 评论 -
JVM:类的生命周期
类的生命周期综述1. 只有当一个类被切实使用到的时候才会被加载到虚拟机中(例如:new, 方法调用, A a = null;不算)2. 若在加载一个类的过程中,有其他类被切实使用到,则会被一同级联加载到JVM中。3. 当一个类中的某个符号被第一次使用到时,该类才会被初始化;当类被加载时,它并未被初始化。4. 初始化顺序:静态函数/变量初始化(Te原创 2016-07-28 15:20:03 · 1058 阅读 · 0 评论 -
Java8 Useful Usage
Convert List<String> to String list.stream().map(Object::toString).collect(Collectors.joining(","));原创 2018-11-07 11:40:50 · 217 阅读 · 0 评论 -
How to config VirtualVM Remote Monitoring with JMX
nohup java \ -server \ -Dcom.sun.management.jmxremote=true \ -Dcom.sun.management.jmxremote.port=8887 \ -Dcom.sun.management.jmxremote.rmi.port=8886 \ -Dcom.sun.management.jmxremote.authenticate...原创 2018-11-29 10:42:43 · 178 阅读 · 0 评论 -
Identify Java code consuming high CPU in Linux
Identify Java code consuming high CPU in Linux (linking JVM thread and Linux PID)February 9, 2011 | By rameshj@zohocorp.com | In Applications ManagerWe can easily identify a pr转载 2012-11-28 13:52:59 · 1710 阅读 · 0 评论 -
Java Exception: java.lang.NoSuchFieldError
Issue:When you access static constant in your program, especially in Web app, you may found that some of static field cannot be access. You will get java.lang.NoSuchFieldError exception. Reason:原创 2012-07-30 15:33:09 · 1839 阅读 · 1 评论 -
用Java生成全局序列UUID
用Java生成全局序列UUIDUUID(Universally Unique Identifier)全局唯一标识符,是指在一台机器上生成的数字,它保证对在同一时空中的所有机器都是唯一的。按照开放软件基金会(OSF)制定的标准计算,用到了以太网卡地址、纳秒级时间、芯片ID码和许多可能的数字。由以下几部分的组合:当前日期和时间(UUID的第一个部分与时间有关,如果你在生成一个UUID之后,过几秒又转载 2009-01-27 21:38:00 · 4138 阅读 · 1 评论 -
Java中的参数传递方式到底是引用传递还是值传递?
Java中的参数传递方式到底是引用传递还是值传递? 事实上,Java中方法参数传递的是原来对象引用的copy(副本)。如果你在方法中改变这个copy中的内容,因为这个copy也是指向原对象,所以改变会生效。给你带来好像Java中存在地址传递一样。而实际上当你对这个对象的引用进行操作,例如object = new SomeObject();这样的操作是无效的,因为你改变的是这个copy(副本),原创 2009-04-13 14:18:00 · 1550 阅读 · 3 评论 -
Java笔试题集锦
Java笔试题集锦1.MVC的各个部分都有那些技术来实现?如何实现? 答:MVC是Model-View-Controller的简写。"Model" 代表的是应用的业务逻辑(通过JavaBean,EJB组件实现), "View" 是应用的表示面(由JSP页面产生),"Controller" 是提供应用的处理过程控制(一般是一个Servlet),通过这种设计模型把应用逻辑,处理过程和显示逻辑分转载 2009-04-25 20:00:00 · 63463 阅读 · 30 评论 -
笔试:当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法? ?(2nd)
当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法?(2nd) 日前在网上见到一道Java笔试试题,如题所述。给出的答案如下:答:不能,一个对象的一个synchronized方法只能由一个线程访问。 本人认为有些所答非所问。故写了两个demo进行测试。发现答案要分三种情况讨论。 情况一:当一个线程进入一个对象的一个sync原创 2009-04-26 15:18:00 · 17293 阅读 · 33 评论 -
Java Compile Error: The code of method is exceeding the 65535 bytes limit
Issue:When you compile your java class, you may got following error. The code of method is exceeding the 65535 bytes limit Reason:According Java specification, one Java method size must be l原创 2010-02-23 16:24:00 · 6446 阅读 · 0 评论 -
Java Exception: java.io.InvalidClassException solution
Issue: When you deploy your EJB application to Weblogic Server and running client to test, you may got following exception. Please note red fonts.d:/Oracle/Middleware/jdk160_11/bin/javaw.exe -client -原创 2010-03-02 11:04:00 · 3120 阅读 · 0 评论 -
Java 语法: abstract interface和interface的区别
interface 本身就是abstract的,只不过没有明确的规定出来,说一定要把abstract这个关键字写上。 所以abstract interface 就是interface,两者根本没有区别。 在《java in a nutshell》里, “All methods of an interface are implicitly abstract, even if the abstr转载 2010-03-31 10:56:00 · 1048 阅读 · 0 评论 -
Java: Keywords Combination Summary
Hi guys, Following is a summary about the combination of Java keywords. Hope it will be useful for all Java guys. For any question, please contact yexianyi@hotmail.com Thanks, Xianyi.Ye Java Keywords Combination Summary原创 2010-06-27 15:48:00 · 787 阅读 · 0 评论 -
JVM如何理解Java泛型类
JVM如何理解Java泛型类转载 2010-07-26 21:12:00 · 989 阅读 · 0 评论 -
How to: How to disable Java Security Warning "The application requires an earlier version of Java."
How to disable Java Security Warning "The application requires an earlier version of Java."1) Close all browsers2) Open the Java Control panel (Start->Control Panel->Java).3) Open the Advanced转载 2012-01-29 14:38:30 · 2648 阅读 · 0 评论