Quantcast
Channel: BlogJava--随笔分类-java
Browsing all 31 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

java知识点

1,double d = 1 / 4;System.out.println(d);//输出为02,    public static void main(String[] args) {        StringBuffer a = new StringBuffer("a");        StringBuffer b = new StringBuffer("b");...

View Article


Image may be NSFW.
Clik here to view.

java基础(续)

StackOverflowError  当应用程序递归太深而发生堆栈溢出时抛出 Jamon(Java Application Monitor)是一款免费的、高性能的、线程安全的Java程序,它使得开发人员能够容易地完成对生产环境应用程序的监控。Java保证读和写32位数或者更小的值是原子操作,也就是说可以在一步完成,因而不可能被打断,因此这样的读和写不需要同步。以下的代码是线程安全(thread...

View Article


Image may be NSFW.
Clik here to view.

log4j

报错:log4j:ERROR Document root element "log4j:configuration",  must match DOCTYPE root "null".解决:Try adding this to the second line (the line below <?xml ...?>)...<!DOCTYPE log4j:configuration...

View Article

Image may be NSFW.
Clik here to view.

JDK5笔记

1,SuppressWarnings的作用是抑制编译器产生警告信息。@SuppressWarnings("unused")@SuppressWarnings("unchecked")eclipse支持的SuppressWarning的值如下,其他开发工具略有差异。all to suppress all warningsboxing to suppress warnings relative to...

View Article

Image may be NSFW.
Clik here to view.

Error: no `server' JVM at `C:\Program Files\Java\jre6\bin\server\jvm.dll

如果报Error: no `server' JVM at `C:\Program Files\Java\jre6\bin\server\jvm.dll的错误,可把jdk下的jre\bin\server下的server文件夹复制到C:\Program Files\Java\jre6\bin目录即可解决。...

View Article


Image may be NSFW.
Clik here to view.

java 应用监控

JavaMelody 能够在QA和实际运行生产环境监测Java或Java EE应用程序服务器。并以图表的形式显示:Java内存和Java CPU使用情况,用户Session数量,JDBC连接数,和http请求、sql请求、jsp页面与业务接口方法(EJB3、Spring、Guice)的执行数量,平均执行时间,错误百分比等。图表可以按天,周,月,年或自定义时间段查看。 jwebap...

View Article

Image may be NSFW.
Clik here to view.

jvm内存分析笔记

1. java.lang.OutOfMemoryError: GC overhead limit exceeded原因   <http://blog.csdn.net/taijianyu/article/details/6606792>   <http://www.sunnybtoc.com/page/M0/S746/746195.html>   2....

View Article

Image may be NSFW.
Clik here to view.

java调用shell

Runtime run = Runtime.getRuntime();String str[] = { "/bin/sh", "-c", "echo '1' >> test.log" };try {    run.exec(str);} catch (IOException e) {}使用Jsch执行Shell脚本...

View Article


Image may be NSFW.
Clik here to view.

CountDownLatch和CyclicBarrier的区别

CountDownLatch : 一个线程(或者多个), 等待另外N个线程完成某个事情之后才能执行。   CyclicBarrier  : N个线程相互等待,任何一个线程完成之前,所有的线程都必须等待。这样应该就清楚一点了,对于CountDownLatch来说,重点是那个“一个线程”, 是它在等待,...

View Article


Image may be NSFW.
Clik here to view.

如何用 Java 获取系统 IP?

参考dubbo里的NetUtils类import java.net.InetAddress;import java.net.NetworkInterface;import java.util.Enumeration;import java.util.regex.Pattern;public class GetIP {public static void main(String[] args)...

View Article

Image may be NSFW.
Clik here to view.

java8国际化直接支持的语言列表

System.out.println("availableLocales :"+ Locale.getAvailableLocales().length);Locale[] arr=Locale.getAvailableLocales(); Arrays.sort(arr, new Comparator<Locale>() { @Override public int...

View Article
Browsing all 31 articles
Browse latest View live