- 浏览: 390802 次
- 性别:
- 来自: 深圳
-
文章分类
最新评论
-
Nabulio:
写的详细,特殊语法学习到了
jdk1.5-1.9新特性 -
wooddawn:
您好,最近在做个足球数据库系统,用到了betbrain的数据表 ...
javascript深入理解js闭包 -
lwpan:
很受启发 update也可以
mysql 的delete from 子查询限制 -
wuliaolll:
不错,总算找到原因了
mysql 的delete from 子查询限制
1."Explain Java class loaders? If you have a class in a package, what do you need to do to run it? Explain dynamic class loading?"
http://blog.csdn.net/duxu2004/article/details/676086
2. Explain static vs. dynamic class loading?
http://blog.csdn.net/chiuan/article/details/7022508
http://blog.csdn.net/tyrone1979/article/details/1164262
3. "What is the difference between constructors and other regular methods? What happens if you do not provide a constructor? Can you call one constructor from another? How do you call the superclass’s constructor?"
4."How do you express an ‘is a’ relationship and a ‘has a’ relationship or explain inheritance and composition? What is the difference between composition and aggregation?"
5.What do you mean by polymorphism, inheritance, encapsulation, and dynamic binding?
polymorphism .[pɔliˈmɔ:fizəm]
inheritance .[ɪnˈherɪtəns]
encapsulation [inˌkæpsjuˈleiʃən]
6.What is the difference between an abstract class and an interface and when should you use them?
7."What is the main difference between an ArrayList and a Vector? What is the main difference between HashMap and Hashtable? What is the difference between a stack and a queue?"
8.Explain the Java Collections Framework?
9.Why do you get a ConcurrentModificationException when using an iterator?
What are some of the best practices relating to Java collection?
http://blog.csdn.net/rush_gogo/article/details/4170415
10."What is the difference between “==” and equals(…) method? What is the difference between shallow comparison and deep comparison of objects?"
11."When providing a user defined key class for storing objects in the HashMaps or Hashtables, what methods do you have to provide or override (i.e. method overriding)? Why?"
12.What is the main difference between a String and a StringBuffer class?
13.What is the main difference between pass-by-reference and pass-by-value?
http://www.iteye.com/topic/202512
http://blog.csdn.net/jabyshen007/article/details/1528490
14.How can you improve Java I/O performance?
http://codermouse.iteye.com/blog/1110445
文件IO消耗分析
Linux在操作文件时,将数据放入文件缓存区,直到内存不够或系统要释放内存给用户进程使用。所以通常情况下只有写文件和第一次读取文件时会产生真正的文件IO。
对于Java应用,造成文件IO消耗高主要是多个线程需要进行大量内容写入(例如频繁的日志写入)的动作、磁盘设备本身的处理速度慢、文件系统慢、操作的文件本身已经很大。
从程序的角度而言,造成文件IO消耗严重的原因主要是多个线程在写进行大量的数据到同一文件,导致文件很快变得很大,从而写入速度越来越慢,并造成各线程激烈争抢文件锁。
常用调优方法:
异步写文件
批量读写
限流
限制文件大小
网络IO消耗分析
对于分布式Java应用,网卡中断是不是均衡分配到各CPU(cat/proc/interrupts查看)。
网络IO消耗严重的解决方法
从程序的角度而言,造成网络IO消耗严重的原因主要是同时需要发送或接收的包太多。
常用调优方法:
限流,限流通常是限制发送packet的频率,从而在网络IO消耗可接受的情况下来发送packget。
15.What is the main difference between shallow cloning and deep cloning of objects?
http://blog.csdn.net/liumingwei2009/article/details/6657881
16.Where and how can you use a private constructor?
sington
17.What is the difference between final, finally and finalize() in Java?
18.Why would you prefer a short circuit “&&, ||” operators over logical “& , |” operators?
19.How does Java allocate stack and heap memory?
20.What is type casting? Explain up casting vs. down casting? When do you get ClassCastException?
21."Discuss the Java error handling mechanism? What is the difference between Runtime (unchecked) exceptions and checked exceptions? What is the implication of catching all the exceptions with the type “Exception”?"
22.What is the difference between processes and threads?Explain different ways of creating a thread?
23.Briefly explain high-level thread states? Explain thread states and how did it switch What design patter do you know? What is a factory pattern?
24.How would you improve performance of a Java application?
http://blog.csdn.net/ajian005/article/details/6422362
性能调优
1 被动的性能调优 自下而上: 计算机及网络(cpu,内存,文件,I/O,网络,), 操作系统(线程,内存,I/O,网络),
应用服务器和数据库(cpu,内存,文件,I/O,网络,),应用程序
在设计,开发,测试阶段进行。
2 主动的性能调优 自上而下:应用程序,应用服务器和数据库(cpu,内存,文件,I/O,网络,),
操作系统(线程,内存,I/O,网络),计算机及网络(cpu,内存,文件,I/O,网络,)
在测试结束,时间紧迫不能修改代码时,实施,上线,升级时。
被动的性能调优步骤:
(1)计算机及网络,操作系统
1) cpu的监控: Unix/Linux 用 top , vmstat , mpstat 命令查看cpu情况,Windows 任务管理器产看
2) 进程资源的监控: top, prstat
3) 内存的监控:vmstat
4) 磁盘的I/O的监控: iostat
5) 网络的I/O的监控: netstat, netstat -ps tcp
6) 系统锁的监控: plockstat
解决方法,增加硬件,修改操作系统参数
(2)Java虚拟机层次的监控 jps
1) jstat -gcutil 5711000
2) 线程互锁的监控: socket, heap, dump, kill -3 <pid>, ps -ef|grep java
3) 内存泄漏的监控: jmap , jhat , jmap -histo 1123
解决方法: 修改参数
(3)应用服务器,数据库层次的监控
1)EJB Container
2)Web Container
3)HTTP Server
4)JDBC Connection Pool
5)JMS Connection Pool
6)ORM Connection Pool
7)高速缓存命中率问题
解决方法:调整参数
(4)应用代码的跟踪
JVMTI
NetBeans Profiler
profiler.netbeans.org
解决方法:代码分析工具,找到瓶颈,修改代码。
被动性能调优的案例分析:
1 内存泄漏问题 : jstat
2 DB连接池: jmap
kill -3 pid, dump
3 大缓存问题
4 外部命令问题 mpstat
5 文件操作问题
25.How would you detect and minimize memory leaks in Java?
http://blog.csdn.net/pkuyjxu/article/details/7329390
26."What do you know about the Java garbage collector? When does the garbage collection occur? Explain different types of references in Java?"
http://blog.csdn.net/duxu2004/article/details/676086
2. Explain static vs. dynamic class loading?
http://blog.csdn.net/chiuan/article/details/7022508
http://blog.csdn.net/tyrone1979/article/details/1164262
3. "What is the difference between constructors and other regular methods? What happens if you do not provide a constructor? Can you call one constructor from another? How do you call the superclass’s constructor?"
4."How do you express an ‘is a’ relationship and a ‘has a’ relationship or explain inheritance and composition? What is the difference between composition and aggregation?"
5.What do you mean by polymorphism, inheritance, encapsulation, and dynamic binding?
polymorphism .[pɔliˈmɔ:fizəm]
inheritance .[ɪnˈherɪtəns]
encapsulation [inˌkæpsjuˈleiʃən]
6.What is the difference between an abstract class and an interface and when should you use them?
7."What is the main difference between an ArrayList and a Vector? What is the main difference between HashMap and Hashtable? What is the difference between a stack and a queue?"
8.Explain the Java Collections Framework?
9.Why do you get a ConcurrentModificationException when using an iterator?
What are some of the best practices relating to Java collection?
http://blog.csdn.net/rush_gogo/article/details/4170415
10."What is the difference between “==” and equals(…) method? What is the difference between shallow comparison and deep comparison of objects?"
11."When providing a user defined key class for storing objects in the HashMaps or Hashtables, what methods do you have to provide or override (i.e. method overriding)? Why?"
12.What is the main difference between a String and a StringBuffer class?
13.What is the main difference between pass-by-reference and pass-by-value?
http://www.iteye.com/topic/202512
http://blog.csdn.net/jabyshen007/article/details/1528490
14.How can you improve Java I/O performance?
http://codermouse.iteye.com/blog/1110445
文件IO消耗分析
Linux在操作文件时,将数据放入文件缓存区,直到内存不够或系统要释放内存给用户进程使用。所以通常情况下只有写文件和第一次读取文件时会产生真正的文件IO。
对于Java应用,造成文件IO消耗高主要是多个线程需要进行大量内容写入(例如频繁的日志写入)的动作、磁盘设备本身的处理速度慢、文件系统慢、操作的文件本身已经很大。
从程序的角度而言,造成文件IO消耗严重的原因主要是多个线程在写进行大量的数据到同一文件,导致文件很快变得很大,从而写入速度越来越慢,并造成各线程激烈争抢文件锁。
常用调优方法:
异步写文件
批量读写
限流
限制文件大小
网络IO消耗分析
对于分布式Java应用,网卡中断是不是均衡分配到各CPU(cat/proc/interrupts查看)。
网络IO消耗严重的解决方法
从程序的角度而言,造成网络IO消耗严重的原因主要是同时需要发送或接收的包太多。
常用调优方法:
限流,限流通常是限制发送packet的频率,从而在网络IO消耗可接受的情况下来发送packget。
15.What is the main difference between shallow cloning and deep cloning of objects?
http://blog.csdn.net/liumingwei2009/article/details/6657881
16.Where and how can you use a private constructor?
sington
17.What is the difference between final, finally and finalize() in Java?
18.Why would you prefer a short circuit “&&, ||” operators over logical “& , |” operators?
19.How does Java allocate stack and heap memory?
20.What is type casting? Explain up casting vs. down casting? When do you get ClassCastException?
21."Discuss the Java error handling mechanism? What is the difference between Runtime (unchecked) exceptions and checked exceptions? What is the implication of catching all the exceptions with the type “Exception”?"
22.What is the difference between processes and threads?Explain different ways of creating a thread?
23.Briefly explain high-level thread states? Explain thread states and how did it switch What design patter do you know? What is a factory pattern?
24.How would you improve performance of a Java application?
http://blog.csdn.net/ajian005/article/details/6422362
性能调优
1 被动的性能调优 自下而上: 计算机及网络(cpu,内存,文件,I/O,网络,), 操作系统(线程,内存,I/O,网络),
应用服务器和数据库(cpu,内存,文件,I/O,网络,),应用程序
在设计,开发,测试阶段进行。
2 主动的性能调优 自上而下:应用程序,应用服务器和数据库(cpu,内存,文件,I/O,网络,),
操作系统(线程,内存,I/O,网络),计算机及网络(cpu,内存,文件,I/O,网络,)
在测试结束,时间紧迫不能修改代码时,实施,上线,升级时。
被动的性能调优步骤:
(1)计算机及网络,操作系统
1) cpu的监控: Unix/Linux 用 top , vmstat , mpstat 命令查看cpu情况,Windows 任务管理器产看
2) 进程资源的监控: top, prstat
3) 内存的监控:vmstat
4) 磁盘的I/O的监控: iostat
5) 网络的I/O的监控: netstat, netstat -ps tcp
6) 系统锁的监控: plockstat
解决方法,增加硬件,修改操作系统参数
(2)Java虚拟机层次的监控 jps
1) jstat -gcutil 5711000
2) 线程互锁的监控: socket, heap, dump, kill -3 <pid>, ps -ef|grep java
3) 内存泄漏的监控: jmap , jhat , jmap -histo 1123
解决方法: 修改参数
(3)应用服务器,数据库层次的监控
1)EJB Container
2)Web Container
3)HTTP Server
4)JDBC Connection Pool
5)JMS Connection Pool
6)ORM Connection Pool
7)高速缓存命中率问题
解决方法:调整参数
(4)应用代码的跟踪
JVMTI
NetBeans Profiler
profiler.netbeans.org
解决方法:代码分析工具,找到瓶颈,修改代码。
被动性能调优的案例分析:
1 内存泄漏问题 : jstat
2 DB连接池: jmap
kill -3 pid, dump
3 大缓存问题
4 外部命令问题 mpstat
5 文件操作问题
25.How would you detect and minimize memory leaks in Java?
http://blog.csdn.net/pkuyjxu/article/details/7329390
26."What do you know about the Java garbage collector? When does the garbage collection occur? Explain different types of references in Java?"
发表评论
-
将json格式的字符数组转为List对象
2015-08-10 15:18 905使用的是json-lib.jar包 将json格式的字符数组 ... -
用httpPost对JSON发送和接收的例子
2015-08-10 11:16 1100HTTPPost发送JSON: private static ... -
zookeeper适用场景:zookeeper解决了哪些问题
2015-07-31 18:01 765问题导读: 1.master挂机 ... -
java泛型
2015-07-29 10:48 770什么是泛型? 泛型(Ge ... -
Java线程Dump分析工具--jstack
2015-06-23 11:09 722jstack用于打印出给定的java进程ID或core fil ... -
什么是spark?
2015-04-10 09:37 495关于Spark: Spark是UC Berkeley AM ... -
dubbo 教程
2015-04-09 19:21 780先给出阿里巴巴dubbo的 ... -
jre/bin目录下面工具说明
2015-03-20 16:45 638jre/bin目录下面工具说明 ... -
JVM系列三:JVM参数设置、分析
2015-01-30 11:18 700不管是YGC还 ... -
jstat使用
2015-01-27 11:11 679jstat 1. jstat -gc pid ... -
查看java堆栈情况(cpu占用过高)
2015-01-27 11:10 7461. 确定占用cpu高的线程id: 方法一: 直接使用 ps ... -
慎用ArrayList的contains方法,使用HashSet的contains方法代替
2015-01-20 14:14 1148在启动一个应用的时候,发现其中有一处数据加载要数分钟,刚开始 ... -
Java虚拟机工作原理详解
2015-01-16 10:00 719一、类加载器首先来 ... -
jdk1.5-1.9新特性
2014-11-11 10:22 83411.51.自动装箱与拆箱:2.枚举(常用来设计单例模式 ... -
java动态代理(JDK和cglib)
2014-09-24 15:51 478JAVA的动态代理 代理模式 代理模式是常用的java设计 ... -
Java动态代理机制详解(JDK 和CGLIB,Javassist,ASM)
2014-09-24 15:45 699class文件简介及加载 Java编译器编译 ... -
怎么用github下载资源
2014-09-24 11:18 4581、下载github:到http://windows. ... -
maven项目时jar包没有到lib目录下
2014-09-01 20:05 2601在建项目时路径都设置好了,为什么在eclipse中运行mav ... -
使用并行计算大幅提升递归算法效率
2014-08-27 15:04 608前言: 无论什么样的 ... -
JAVA 实现FTP
2014-08-22 14:41 708一个JAVA 实现FTP功能的代码,包括了服务器的设置模块, ...
相关推荐
定期收集总结各大公司java面试、笔试题给大家分享。共同进步。
IKM考试认证;汇丰银行等等公司入职认证,进入500强门坎。 IKM考试认证;汇丰银行等等公司入职认证,进入500强门坎。 IKM考试认证;汇丰银行等等公司入职认证,进入500强门坎。 IKM考试认证;汇丰银行等等公司入职...
### Java基础知识 1. **JDK与JRE的区别:** - **JRE(Java Runtime Environment):** 这是运行Java程序所必需的基本环境。它包括了Java虚拟机(JVM)、类库和其他的一些基本组件。 - **JDK(Java Development Kit...
根据提供的文件信息,这份《Java Interview Notes_ 700 Java Interview Questions Answered.pdf》的文档内容非常丰富,涵盖了Java编程语言面试时可能遇到的多个核心知识点。下面是根据标题和描述生成的知识点详细...
### Java Interview Questions 更新于2018年9月 #### 1. 什么是JVM? JVM(Java虚拟机)是运行Java应用程序所必需的解释器及其运行时环境的组合。它提供了一个运行Java字节码的标准平台,使得Java程序可以在任何...
本文将基于标题"Java Interview Questions/Java面试题"和提供的标签"源码"、"工具"来探讨一些常见的Java面试知识点。 1. **Java语言基础** - 数据类型:了解基本数据类型及其内存占用,以及自动装箱拆箱原理。 - ...
Java/J2EE interview questions这本书是为准备面试的Java开发者准备的,涵盖了核心概念、设计和编码问题,以及如何应对面试中可能遇到的问题。 核心概念包括Java语言基础,比如Java语言的基本原则、语法、核心库的...
Java面试问题解析 Java作为一款广泛应用的编程语言,其面试环节常常涉及到许多核心概念和技术细节。以下是一些常见的Java面试问题及其详细解答: 1. **为什么Java是平台独立的语言?** Java之所以被称为平台独立...
Java面试是每位Java开发者职业生涯中的重要环节,它不仅测试了候选人的基础知识,还评估了他们的实际问题解决能力。以下是一些常见的Java面试问题及其详细解释,涵盖了基础、进阶和实践方面: 1. **基本概念** - *...
### Java Interview Questions and Answers #### 1. 什么是 Java?解释其含义与定义。 Java 是当今最流行的编程语言之一,在 Web 应用程序、移动应用、软件开发、游戏系统以及服务器端技术等领域扮演着重要角色。...
java面试题_java-interview-questions-master.zip2、在 Java 程序中怎么保证多线程的运行安全? 出现线程安全问题的原因一般都是三个原因: 1、 线程切换带来的原子性问题 解决办法:使用多线程之间同步...
从国外网站上下载的Java面试题。可以看看国外公司的Java面试常用题,以及如何用英文回答。
在面试中,Java Collections 相关的问题是非常常见的,本文将对 Java Collections Interview Questions 进行详细解释。 ArrayList 和 LinkedList 的区别 ArrayList 和 LinkedList 都是 List 接口的实现类,但是...
t as simple as sitting down and answering questions The technical coding portion of the interview can be akin to a difficult puzzle or an interrogation With Java Programming Interviews Exposed skilled...
Java 8 面试问题总结 Java 8 是 Java 语言的最新版本,具有许多新的特性和改进。了解 Java 8 的新特性对于 Java 开发者非常重要。本文总结了 Java 8 的一些重要特性和面试问题,涵盖了 Java 8 的新特性、编程范式、...
Java字符串面试问题详解 Java字符串是Java编程语言中最基本的数据类型之一,在Java面试中,字符串问题是非常常见的。本文将详细解释Java字符串面试问题,包括字符串的声明、字符串池、字符串的不可变性、字符串比较...
Interview Questions in Core Java 1.what is a transient variable? A transient variable is a variable that may not be serialized.
"Core Java Interview Questions"这个资源集锦了面试中可能会遇到的一些关键问题,旨在帮助求职者更好地准备Java核心技术的面试。以下是根据描述和标签提炼出的一些核心Java知识点: 1. **Java基础** - 类与对象:...