├── j2ee ├── dao.md ├── README.md ├── what_must_be_implemented_by_all_servlets.md ├── what_is_servlet.md ├── jsp_directives.md ├── jsp_language.md ├── jsp_translation.md ├── types_of_comments.md ├── what_are_types_of_j2ee_clients.md ├── scope_for_the__jsp__usebean__tag_-.md ├── what_are_the_phases_of_the_servlet_life_cycle.md ├── what_are_the_four_components_of_j2ee_application.md ├── jsp_expressions.md ├── creat_servlet.md ├── uri_url.md ├── ear,_jar_and_war_files.md ├── -_transaction.md ├── what_does_application_client_module_contain.md ├── what_is_j2ee.md ├── what_are_jsp_declarations.md ├── what_does_web_module_contain.md ├── jsp.md ├── types_of_directive_tags.md ├── what_is_hibernate.md ├── what_do_you_understand_by_jsp_actions.md ├── jspforward_page=___responsesendredirecturl.md ├── jsp__include_page_=___and____include_file_=.md └── jsp_lifecycle.md ├── java ├── programme.md ├── abstract.md ├── multi-thread.md ├── README.md ├── ide.md ├── probleme_sur_chaine.md ├── collection.md ├── string_class.md ├── visitor_pattern.md ├── inherit_string_class.md ├── class_variable.md ├── what_is_the_base_class_of_all_classes.md ├── list,_set,_map_interface.md ├── construcor_override.md ├── java_multi.md ├── what_is_a_instance_variable.md ├── what_is_a_local_variable.md ├── list_some_java_keywordsunlike_c,_c++_keywords.md ├── what_method_must_be_implemented_by_all_threads.md ├── when_a_thread_is_created_and_started,_what_is_its_initial_state.md ├── does_java_support_multiple_inheritance.md ├── feature.md ├── is_it_necessary_that_each_try_block_must_be_followed_by_a_catch_block.md ├── which_methods_of_serializable_interface_should_i_implement.md ├── final.md ├── matrice_a_deux_dimensions_java.md ├── how_java_enabled_high_performance.md ├── int_integer.md ├── list_map.md ├── transient.md ├── what_do_you_mean_by_object.md ├── how_are_this_and_super_used_with_constructors.md ├── list_set_map_diff.md ├── what_is_the_differren_between abstract class and interface.md ├── does_garbage_collection_guarantee_that_a_program_will_not_run_out_of_memory.md ├── stringbuffer__stringbuilder.md ├── what_is_difference_between_path_and_classpath.md ├── 5_exemple.md ├── stringbuilder.md ├── thread_runnable.md ├── what_is_abstract.md ├── how_do_i_serialize_an_object_to_a_file.md ├── different_ways_to_handle_exceptions.md ├── error_and_an_exception.md ├── abstraction.md ├── when_you_serialize_an_object,_what_happens_to_the_object_references_included_in_the_object.md ├── encapsulation.md ├── what_is_the_common_usage_of_serialization.md ├── aaa.md ├── interfqce_abstraction.md ├── interface.md ├── what_one_should_take_care_of_while_serializing_the_object.md ├── orient_object.md ├── stream_writer.md ├── final,_finally,_finalize.md ├── hashmap_hashtable.md ├── working_zone.md ├── how_to_set_muliti-thread.md ├── if_i_want_an_object_of_my_class_to_be_thrown_as_an_exception_object,_what_should_i_do.md ├── sleep_and_wait.md ├── difference_between_and_symbol.md ├── what_ate_object-oriented_features.md ├── externalizable_interface.md ├── string_object.md ├── static_wya.md ├── string_question.md ├── heap_stack.md ├── reflection.md ├── what_kind_of_variables_a_class_can_consist_of.md ├── what_is_the_difference_between_preemptive_scheduling_and_time_slicing.md ├── what_do_you_know_about_java.md ├── what_happens_to_the_static_fields_of_a_class_during_serialization.md ├── how_can_i_customize_the_seralization_process_ie_how_can_one_have_a_control_over_the_serialization_process.md ├── array.md ├── stringbuffer_questions.md ├── what_is_daemon_thread_and_which_method_is_used_to_create_the_daemon_thread.md ├── checked_exception.md ├── static.md ├── what_are_synchronized_methods_and_synchronized_statements.md ├── article11.md ├── supergetclass.md ├── gabage_collection.md ├── question_interface_1.md ├── static_questions.md ├── synchronized.md ├── synchroniz.md ├── hashmap_hashtable_linkedhashmap_treemap.md ├── equals_and_==.md ├── serialization.md ├── what_is_singleton_class.md ├── initialization_and_cleanup.md ├── arraylist_vector.md ├── what_is_the_difference_between_a_jdk_and_a_jvm.md ├── abstract_question.md ├── try_catch_finally.md ├── ==_equal.md ├── java_data_types.md ├── article_differe.md ├── the_difference_between_static_variables_and_instance_variables.md ├── if_i_write_return_at_the_end_of_the_try_block,_will_the_finally_block_still_execute.md ├── collection_questions.md ├── polymorphism.md ├── hashcode__equal.md ├── integer_==.md ├── run-time_data_areas.md ├── super_gai_nian.md ├── exception_question1.md ├── this_question.md ├── string_questions.md ├── question_interface_2.md └── super_question_1.md ├── spring ├── README.md ├── how_do_add_a_bean_in_spring_application.md ├── join_point.md ├── pointcut.md ├── what_are_spring_beans.md ├── can_you_inject_null_and_empty_string_values_in_spring.md ├── introduction.md ├── autowire.md ├── ioc_tyoe.md ├── what_is_spring_configuration_file.md ├── how_do_you_provide_configuration_metadata_to_the_spring_container.md ├── what_is_spring_ioc_container.md ├── what_is_annotation-based_container_configuration.md ├── qc.md ├── what_are_types_of_ioc_containers_explain_them.md ├── what_is_spring.md ├── ioc_good.md ├── are_singleton_beans_thread.md ├── bf_and_ac.md ├── what_are_the_different_modules_in_spring_framework.md ├── which_di.md ├── what_is_dependency_injection.md ├── what_is_aop.md ├── how_can_you_inject_java_collection_in_spring.md ├── autowired_inject_resource.md ├── spring_bean_scope.md ├── types_of_advice.md ├── bean_lifecycle.md └── what_are_benefits_of_using_spring.md ├── hibernate ├── README.md ├── is_sessionfactory_thread-safe.md ├── what_is_session_in_hibernate.md ├── what_is_the_file_extension_used_for_hibernate_mapping_file.md ├── sorted_and_ordered_collection.md ├── what_is_sessionfactory_in_hibernate.md ├── hibernate_three.md └── get_and_load.md ├── linux ├── README.md ├── list_file.md └── find_file.md ├── sql ├── one_to_one.md ├── union_all.md ├── multi_to_multi.md ├── full_join.md ├── one_to_multi.md ├── what_type_of_joins_have_you_used.md ├── inner_join.md ├── where_having.md ├── leftright_join.md ├── what_type_of_wildcards_have_you_used.md ├── union.md └── README.md ├── images └── java_run_time_data_areas.jpeg ├── scrum ├── whats_sprint.md ├── README.md ├── scrum_chara.md └── how_to_scrum.md ├── jdbc ├── callable_statement.md ├── what_does_the_classfornamemyclass_do.md ├── stored_procedure_and_how_do_you_call_it_in_jdbc.md ├── what_is_difference_between_statement_and_prepared_statement.md ├── connection_pooling.md └── what_are_the_steps_in_the_jdbc_connection.md ├── .gitattributes ├── README.md ├── continuous_integration └── README.md └── SUMMARY.md /j2ee/dao.md: -------------------------------------------------------------------------------- 1 | # DAO 2 | -------------------------------------------------------------------------------- /java/programme.md: -------------------------------------------------------------------------------- 1 | # Programme 2 | -------------------------------------------------------------------------------- /spring/README.md: -------------------------------------------------------------------------------- 1 | # Spring 2 | -------------------------------------------------------------------------------- /hibernate/README.md: -------------------------------------------------------------------------------- 1 | # Hibernate 2 | -------------------------------------------------------------------------------- /java/abstract.md: -------------------------------------------------------------------------------- 1 | # abstract 程序题 2 | -------------------------------------------------------------------------------- /linux/README.md: -------------------------------------------------------------------------------- 1 | # Linux 2 | 3 | 4 | -------------------------------------------------------------------------------- /java/multi-thread.md: -------------------------------------------------------------------------------- 1 | # Multi-Thread 2 | -------------------------------------------------------------------------------- /java/README.md: -------------------------------------------------------------------------------- 1 | # Java 2 | 3 | 第一部分是 Java 的基础面试题 补充ing 4 | -------------------------------------------------------------------------------- /j2ee/README.md: -------------------------------------------------------------------------------- 1 | # What are considered as a web component? 2 | -------------------------------------------------------------------------------- /java/ide.md: -------------------------------------------------------------------------------- 1 | # 列举出2个 IDE 2 | 3 | Netbeans, Eclipse, etc. 4 | -------------------------------------------------------------------------------- /java/probleme_sur_chaine.md: -------------------------------------------------------------------------------- 1 | # Problem on chain 2 | 3 | 4 | -------------------------------------------------------------------------------- /java/collection.md: -------------------------------------------------------------------------------- 1 | # Collection 2 | 3 | Collection 的子类是 List 和 Set 4 | -------------------------------------------------------------------------------- /java/string_class.md: -------------------------------------------------------------------------------- 1 | # 是否可以继承 String 类? 2 | 3 | String 类是 final 类不可以被继承 4 | -------------------------------------------------------------------------------- /java/visitor_pattern.md: -------------------------------------------------------------------------------- 1 | # Visitor Pattern 2 | 3 | Visitor -- switch case 4 | -------------------------------------------------------------------------------- /linux/list_file.md: -------------------------------------------------------------------------------- 1 | # 列出文件列表 2 | 3 | ls 4 | 5 | 列出当前目录的所有内容 6 | 7 | 8 | -------------------------------------------------------------------------------- /sql/one_to_one.md: -------------------------------------------------------------------------------- 1 | # 设计一对一 2 | 3 | 一对一可以两个实体设计在一个数据库中.例如设计一个夫妻表,里面放丈夫和妻子 4 | -------------------------------------------------------------------------------- /hibernate/is_sessionfactory_thread-safe.md: -------------------------------------------------------------------------------- 1 | # SessionFactory 是线程安全的吗? 2 | 3 | 是的 4 | -------------------------------------------------------------------------------- /java/inherit_string_class.md: -------------------------------------------------------------------------------- 1 | # 是否可以继承 String 类? 2 | 3 | String 类是 final 类不可以被继承 4 | -------------------------------------------------------------------------------- /java/class_variable.md: -------------------------------------------------------------------------------- 1 | # 类变量 classs variable 2 | 3 | 在类里但在方法外, 加了 static 关键字. 也可以叫做静态变量 4 | -------------------------------------------------------------------------------- /java/what_is_the_base_class_of_all_classes.md: -------------------------------------------------------------------------------- 1 | # 所有类的基类是哪个类? 2 | 3 | java.lang.Object 4 | -------------------------------------------------------------------------------- /sql/union_all.md: -------------------------------------------------------------------------------- 1 | # Union 和 Union all? 2 | 3 | UNION 操作符选取不同的值. 如果允许重复的值,使用 UNION ALL. 4 | -------------------------------------------------------------------------------- /java/list,_set,_map_interface.md: -------------------------------------------------------------------------------- 1 | # List, Set, Map是否继承自Collection接口? 2 | 3 | List,Set是,Map不是 4 | -------------------------------------------------------------------------------- /spring/how_do_add_a_bean_in_spring_application.md: -------------------------------------------------------------------------------- 1 | # How do add a bean in spring application? 2 | -------------------------------------------------------------------------------- /sql/multi_to_multi.md: -------------------------------------------------------------------------------- 1 | # multi to multi 2 | 3 | 多对多可以多加一张中间表,将另外两个表的主键放到这个表中(如教师和学生就是多对多的关系) 4 | -------------------------------------------------------------------------------- /j2ee/what_must_be_implemented_by_all_servlets.md: -------------------------------------------------------------------------------- 1 | # Servlet 必须实现什么接口? 2 | 3 | Servlet Interface 4 | -------------------------------------------------------------------------------- /java/construcor_override.md: -------------------------------------------------------------------------------- 1 | # 构造器是否可以被 override 2 | 3 | 构造器不能被继承 所以不能被 override 但可以被重载 overload 4 | -------------------------------------------------------------------------------- /spring/join_point.md: -------------------------------------------------------------------------------- 1 | # Join point? 2 | 3 | 是我们刻意加入 AOP 切面的位置. 实际上它是程序里某个动作发生的地方, 4 | 比如某个程序的执行. 5 | -------------------------------------------------------------------------------- /java/java_multi.md: -------------------------------------------------------------------------------- 1 | # 一个 .java 源文件是否可以包含多个类 2 | 3 | 可以得 4 | 5 | 但只能有一个是 public 的类 而且这个 public 类必须与文件名一样 6 | -------------------------------------------------------------------------------- /java/what_is_a_instance_variable.md: -------------------------------------------------------------------------------- 1 | # 实例变量 Instance Variable 2 | 3 | 在类里但是不在方法里 4 | 5 | 在类被载入的时候被实例化 6 | -------------------------------------------------------------------------------- /java/what_is_a_local_variable.md: -------------------------------------------------------------------------------- 1 | # 本地变量 Local Variable 2 | 3 | 在方法体 构造体内部定义的变量 4 | 5 | 在方法结束的时候就被摧毁 6 | -------------------------------------------------------------------------------- /java/list_some_java_keywordsunlike_c,_c++_keywords.md: -------------------------------------------------------------------------------- 1 | # 列出 Java 独有的关键字 2 | 3 | import, super, finally, etc. 4 | -------------------------------------------------------------------------------- /spring/pointcut.md: -------------------------------------------------------------------------------- 1 | # Pointcut 2 | 3 | This is a set of one or more joinpoints where an advice should be executed. 4 | -------------------------------------------------------------------------------- /spring/what_are_spring_beans.md: -------------------------------------------------------------------------------- 1 | # 什么是 Spring beans? 2 | 3 | 一个 bean 是被实例化, 4 | 组装, 5 | 以及由Spring IoC容器管理的对象. 6 | -------------------------------------------------------------------------------- /sql/full_join.md: -------------------------------------------------------------------------------- 1 | # Full join 2 | 3 | FULL JOIN 称为 FULL OUTER JOIN 4 | 5 | FULL JOIN 关键字会从左表和右表那里返回所有的行, 即使没有匹配 6 | -------------------------------------------------------------------------------- /java/what_method_must_be_implemented_by_all_threads.md: -------------------------------------------------------------------------------- 1 | # 所有的线程都必须实现哪个方法? 2 | 3 | run() 方法, 不管是继承 Thread 还是实现 Runnable 接口. 4 | -------------------------------------------------------------------------------- /java/when_a_thread_is_created_and_started,_what_is_its_initial_state.md: -------------------------------------------------------------------------------- 1 | # 一个线程的初始状态是什么? 2 | 3 | 一个线程被创建和开始之后是 “Ready” 状态. 4 | -------------------------------------------------------------------------------- /spring/can_you_inject_null_and_empty_string_values_in_spring.md: -------------------------------------------------------------------------------- 1 | # Can you inject null and empty string values in Spring? 2 | -------------------------------------------------------------------------------- /sql/one_to_multi.md: -------------------------------------------------------------------------------- 1 | # One to multi 2 | 3 | 一对多可以建两张表,将一这一方的主键作为多那一方的外键,例如一个学生表可以加一个字段指向班级(班级与学生一对多的关系) 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /images/java_run_time_data_areas.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DONGChuan/Code-Note-Book/HEAD/images/java_run_time_data_areas.jpeg -------------------------------------------------------------------------------- /spring/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction? 2 | 3 | An introduction allows you to add new methods or attributes to existing classes. 4 | -------------------------------------------------------------------------------- /j2ee/what_is_servlet.md: -------------------------------------------------------------------------------- 1 | # 什么是 servlet? 2 | 3 | Servlets 是服务器端的部件 4 | 5 | 是纯的 java 对象 6 | 7 | 设计用于多种协议 特别是HTTP 8 | 9 | 10 | -------------------------------------------------------------------------------- /j2ee/jsp_directives.md: -------------------------------------------------------------------------------- 1 | # JSP Directives? 2 | 3 | A JSP directive affects the overall structure of the servlet class. 通俗的讲就是告诉引擎如何处理其余JSP页面 4 | -------------------------------------------------------------------------------- /scrum/whats_sprint.md: -------------------------------------------------------------------------------- 1 | # What's sprint? 2 | 3 | Sprint是短距离赛跑的意思,这里面指的是一次迭代,而一次迭代的周期是1个月时间(即4个星期),也就是我们要把一次迭代的开发内容以最快的速度完成它,这个过程我们称它为Sprint。 4 | -------------------------------------------------------------------------------- /spring/autowire.md: -------------------------------------------------------------------------------- 1 | # 什么是自动装配 2 | 3 | Spring 自动解决 bean 之间的关系. 4 | 通过检查 BeanFactory 中的内容, 5 | 而无需使用````和````元素 6 | -------------------------------------------------------------------------------- /spring/ioc_tyoe.md: -------------------------------------------------------------------------------- 1 | # IoC 的类型? 2 | 3 | * Constructor-based dependency injection: 4 | 5 | * Setter-based dependency injection: 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring/what_is_spring_configuration_file.md: -------------------------------------------------------------------------------- 1 | # 什么是 Spring 的配置文件? 2 | 3 | Spring 的配置文件是一个 XML 文件. 4 | 5 | 这个文件包含类的或者说 bean 的信息以及它们是如何配置的 6 | -------------------------------------------------------------------------------- /java/does_java_support_multiple_inheritance.md: -------------------------------------------------------------------------------- 1 | # Does Java support multiple inheritance? 2 | 3 | Java doesn't support multiple inheritance. 4 | -------------------------------------------------------------------------------- /java/feature.md: -------------------------------------------------------------------------------- 1 | # Java 的一些特点? 2 | 3 | * Object Oriented 面向目标的 4 | * Platform Independent 平台独立 5 | * Interpreted 解释性语言 6 | * Multi-threaded 多线程 7 | -------------------------------------------------------------------------------- /spring/how_do_you_provide_configuration_metadata_to_the_spring_container.md: -------------------------------------------------------------------------------- 1 | # How do you provide configuration metadata to the Spring Container? 2 | -------------------------------------------------------------------------------- /hibernate/what_is_session_in_hibernate.md: -------------------------------------------------------------------------------- 1 | # What is Session in Hibernate? 2 | 3 | * Session 代表一个小单位的工作 4 | 5 | * 它保持与数据库的连接 6 | 7 | * 并且它们是非线程安全的 8 | -------------------------------------------------------------------------------- /java/is_it_necessary_that_each_try_block_must_be_followed_by_a_catch_block.md: -------------------------------------------------------------------------------- 1 | # 每一个 try 都必须有一个 catch 吗? 2 | 3 | 不是必须的. 至少要有一个 catch 或者 finally 块. 4 | -------------------------------------------------------------------------------- /java/which_methods_of_serializable_interface_should_i_implement.md: -------------------------------------------------------------------------------- 1 | # 必须实现 Serializable 接口的哪个方法? 2 | 3 | Serializable 接口是一个空接口. 4 | 所以我们不实现它的任何方法. 5 | -------------------------------------------------------------------------------- /spring/what_is_spring_ioc_container.md: -------------------------------------------------------------------------------- 1 | # IoC container 是什么? 2 | 3 | 管理 bean 的生命周期 (从创建,配置等等再到摧毁) 4 | 5 | 通过 dependency injection (DI) 管理构成一个应用各个部件 6 | -------------------------------------------------------------------------------- /java/final.md: -------------------------------------------------------------------------------- 1 | # final 关键字 2 | 3 | final 类是不能被继承的 这个类就是最终的了 不需要再继承修改 比如很多 java 标准库就是 final 类 4 | 5 | final 方法不能被子方法重写 6 | 7 | final + static 变量表示常量 8 | -------------------------------------------------------------------------------- /java/matrice_a_deux_dimensions_java.md: -------------------------------------------------------------------------------- 1 | # 定义二维数组 2 | 3 | float[][] numthree; 4 | short[][] numfour=new short[5][8]; 5 | long[][] numfive=new long[5][]; 6 | -------------------------------------------------------------------------------- /spring/what_is_annotation-based_container_configuration.md: -------------------------------------------------------------------------------- 1 | # Annotation-based container configuration? 2 | 3 | 不用 XML 去描述 bean 的装配, 4 | 而是在类的代码里使用注释来配置 5 | -------------------------------------------------------------------------------- /hibernate/what_is_the_file_extension_used_for_hibernate_mapping_file.md: -------------------------------------------------------------------------------- 1 | # What is the file extension used for hibernate mapping file? 2 | 3 | filename.hbm.xml 4 | -------------------------------------------------------------------------------- /java/how_java_enabled_high_performance.md: -------------------------------------------------------------------------------- 1 | # Java 为什么是高效的 ( High Performance )? 2 | 3 | 因为 Java 使用 Just-In-Time (即时) 编译器. 4 | 5 | 把java字节码直接转换成可以直接发送给处理器的指令的程序. 6 | -------------------------------------------------------------------------------- /spring/qc.md: -------------------------------------------------------------------------------- 1 | # ApplicationContext 的实现都有哪些? 2 | 3 | * FileSystemXmlApplicationContext 4 | 5 | * ClassPathXmlApplicationContext 6 | 7 | * WebXmlApplicationContext 8 | -------------------------------------------------------------------------------- /spring/what_are_types_of_ioc_containers_explain_them.md: -------------------------------------------------------------------------------- 1 | # IoC containers 类型? 2 | 3 | * Bean Factory container 4 | 5 | * Spring ApplicationContext Container 6 | 7 | -------------------------------------------------------------------------------- /j2ee/jsp_language.md: -------------------------------------------------------------------------------- 1 | # JSP language 2 | 3 | * <%@ directive %> 4 | * <%! declaration %> 5 | * <%= expression %> 6 | * <% code fragment %> 7 | * <%-- comment --%> 8 | 9 | -------------------------------------------------------------------------------- /java/int_integer.md: -------------------------------------------------------------------------------- 1 | # int 与 integer 2 | 3 | int 是数据类型 4 | 5 | interger 是 int 的封装类 6 | 7 | int 默认值为 0 8 | interger 默认值为 null 所以 interger 可以用来判断变量是否赋值 即 null 和 0 的区别 9 | -------------------------------------------------------------------------------- /java/list_map.md: -------------------------------------------------------------------------------- 1 | # List 和 Map 2 | 3 | 一个是存储单列数据的集合 4 | 5 | 另一个是存储键和值这样的双列数据的集合 6 | 7 | List中存储的数据是有顺序并且允许重复 8 | 9 | Map中存储的数据是没有顺序的,其键是不能重复的,它的值是可以有重复的. 10 | -------------------------------------------------------------------------------- /java/transient.md: -------------------------------------------------------------------------------- 1 | # Transient 关键字 2 | 3 | 当持久化对象时, 4 | 可能有一个特殊的对象数据成员, 5 | 我们不想用 serialization 机制来保存它. 为了在一个特定对象的一个域上关闭serialization, 6 | 可以在这个域前加上关键字transient. 7 | 8 | -------------------------------------------------------------------------------- /java/what_do_you_mean_by_object.md: -------------------------------------------------------------------------------- 1 | # 什么是对象 (Object)? 2 | 3 | * 对象是程序运行时的实体 4 | * 它的状态存储在 fields (也就是变量) 5 | * 行为是通过方法 (method) 实现的 6 | * 方法上操作对象的内部的状态 7 | * 方法是对象对对象的通信的主要手段 8 | -------------------------------------------------------------------------------- /linux/find_file.md: -------------------------------------------------------------------------------- 1 | 2 | # 查找文件 3 | 4 | 通过名字查找文件 5 | 6 | find -name "nameFile" 7 | 8 | 但是分大小写. 9 | 10 | 如果不区分大小写用下面的命令: 11 | 12 | find -iname "nameFile" 13 | -------------------------------------------------------------------------------- /sql/what_type_of_joins_have_you_used.md: -------------------------------------------------------------------------------- 1 | # 都使用过哪些join? 2 | 3 | 初学者说这2个 4 | inner join 5 | (left/right) outer join 6 | 7 | 再牛逼点补充下下面2个 8 | cross join 9 | self-join 10 | -------------------------------------------------------------------------------- /java/how_are_this_and_super_used_with_constructors.md: -------------------------------------------------------------------------------- 1 | # this() 和 super() 在构造体里怎么用? 2 | 3 | this() 在同一个类的构造体被调用. this("toto","tata",1)相当于调用对应参数的构造体. 4 | 5 | super() 用来调用父类构造体. 6 | -------------------------------------------------------------------------------- /spring/what_is_spring.md: -------------------------------------------------------------------------------- 1 | # 什么是 Spring? 2 | 3 | Spring 是 Java EE 的是一个轻量级的开源框架. 4 | 5 | 使 J2EE 开发更容易 6 | 7 | 通过实现基于POJO的编程模型 8 | 9 | Spring 的核心 design pattern 是 IOC 10 | -------------------------------------------------------------------------------- /j2ee/jsp_translation.md: -------------------------------------------------------------------------------- 1 | # JSP translation? 2 | 3 | Conversion of the JSP Page into a Java Servlet. This class is essentially a servlet class wrapped with features for JSP functionality. 4 | -------------------------------------------------------------------------------- /java/list_set_map_diff.md: -------------------------------------------------------------------------------- 1 | # List Set Map 比较 2 | 3 | Set 不允许有重复的元素. Set取元素时,没法说取第几个,只能以Iterator接口取得所有的元素,再逐一遍历各个元素. 4 | 5 | List表示有先后顺序的集合 6 | 7 | Map与List和Set不同,存储一对key/value,不能存储重复的key 8 | -------------------------------------------------------------------------------- /java/what_is_the_differren_between abstract class and interface.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DONGChuan/Code-Note-Book/HEAD/java/what_is_the_differren_between abstract class and interface.md -------------------------------------------------------------------------------- /java/does_garbage_collection_guarantee_that_a_program_will_not_run_out_of_memory.md: -------------------------------------------------------------------------------- 1 | # GC 就一定能保证内存不溢出吗? 2 | 3 | Non. 4 | 程序员可能创建了一个对象, 5 | 以后一直不再使用这个对象, 6 | 这个对象却一直被引用, 7 | 这个对象无用但是却无法被垃圾回收器回收的 8 | -------------------------------------------------------------------------------- /java/stringbuffer__stringbuilder.md: -------------------------------------------------------------------------------- 1 | # StringBuffer 和 StringBuilder 2 | 3 | * StringBuilder 比 StringBuffer 快 4 | * 当需要保证线程安全的时候用 StringBuffer 5 | * StringBuffer 是 synchronized, StringBuilder 不是. 6 | -------------------------------------------------------------------------------- /java/what_is_difference_between_path_and_classpath.md: -------------------------------------------------------------------------------- 1 | # Path 与 Classpath? 2 | 3 | Path 和 Classpath 是操作系统的环境变量. 4 | 5 | * Path 定义了系统可以在哪里找到可执行文件(.exe) 6 | 7 | * classpath 定义了 .class 文件的位置. 8 | -------------------------------------------------------------------------------- /java/5_exemple.md: -------------------------------------------------------------------------------- 1 | # 写出你最常见到的5个runtime exception 2 | 3 | ClassCastException 4 | IllegalArgumentException 5 | NullPointerException 6 | IndexOutOfBoundsException 7 | ArrayIndexOutOfBoundsException 8 | 9 | -------------------------------------------------------------------------------- /java/stringbuilder.md: -------------------------------------------------------------------------------- 1 | # StringBuilder 是什么? 2 | 3 | String 类一般被认为是不可改变的. 如果需要对一个String做许多修改就需要使用StringBuffer或者StringBuilder. 4 | 5 | 在Oracle里的定义就是 6 | "A mutable sequence of characters." 7 | 8 | 9 | -------------------------------------------------------------------------------- /java/thread_runnable.md: -------------------------------------------------------------------------------- 1 | # Thread 与 Runnable? 2 | 3 | 实现Runnable接口比继承Thread类所具有的优势: 4 | 5 | * 适合多个相同的程序代码的线程去处理同一个资源 6 | 7 | * 可以避免java中的单继承的限制 8 | 9 | * 增加程序的健壮性,代码可以被多个线程共享,代码和数据独立。 10 | -------------------------------------------------------------------------------- /jdbc/callable_statement.md: -------------------------------------------------------------------------------- 1 | # Callable statement? 2 | 3 | PreparedStatement继承自Statement 4 | CallableStatement继承自PreparedStatement 5 | 6 | It's used when you want to access database stored procedures 7 | -------------------------------------------------------------------------------- /java/what_is_abstract.md: -------------------------------------------------------------------------------- 1 | # 抽象 abstract 2 | 3 | **Abstract 类** 4 | 5 | * 不能实例化 6 | 7 | **Abstract 方法** 8 | 9 | * 在父类里定义抽象方法,在子类里定义这个具体的方法,所以它是抽象的. 10 | 11 | **好处** 12 | 13 | 减少复杂度和提高可维护性 14 | -------------------------------------------------------------------------------- /java/how_do_i_serialize_an_object_to_a_file.md: -------------------------------------------------------------------------------- 1 | # 如何序列化一个对象到一个文件? 2 | 3 | 要被序列化的实例所对应的类必须实现 Serializable 接口. 然后你可以把实例传递给 ObjectOutputStream, 同时 ObjectOutputStream 也必须连接至 fileoutputstream. 这样就会把一个对象储存到一个文件里. 4 | -------------------------------------------------------------------------------- /spring/ioc_good.md: -------------------------------------------------------------------------------- 1 | 2 | # IoC 有什么好处? 3 | 4 | * 减少代码 5 | 6 | * 是应用更容易测试 7 | 8 | * 松耦合 (Loose coupling) 和最小的侵入性 9 | 10 | * IOC containers support eager instantiation and lazy loading of services. 11 | -------------------------------------------------------------------------------- /java/different_ways_to_handle_exceptions.md: -------------------------------------------------------------------------------- 1 | # 处理异常的方法 2 | 3 | 1. try catch. 4 | 5 | 2. throws. 6 | 7 | 这两种方法有什么区别 8 | 9 | 第一种方法是自己处理异常. 10 | 11 | 第二种异常是把异常抛给调用这个方法的模块去处理. 一般 Java 的库就是怎么处理的. 12 | 13 | -------------------------------------------------------------------------------- /java/error_and_an_exception.md: -------------------------------------------------------------------------------- 1 | # error 和 exception? 2 | 3 | Error表示应用程序本身无法克服和恢复的一种严重问题, 4 | 程序只有死的份了, 5 | 例如, 6 | 说内存溢出和线程死锁等系统问题 7 | 8 | Exception 表示程序还能够克服和恢复的问题, 9 | 比如一个输入参数不对引起的异常. 其中又分为系统异常和普通异常 10 | -------------------------------------------------------------------------------- /spring/are_singleton_beans_thread.md: -------------------------------------------------------------------------------- 1 | # Singleton bean 是线程安全的吗? 2 | 3 | 不是 4 | 5 | *PS 什么叫线程安全* 6 | 7 | *一段代码,同时几个线程同时使用,结果都是正确的,就叫线程安全.* 8 | 9 | *比如我们打开百度知道的首页,全世界很多人都在打开,都是正确的,证明百度知道首页的那段代码是线程安全的.* 10 | -------------------------------------------------------------------------------- /j2ee/types_of_comments.md: -------------------------------------------------------------------------------- 1 | # 注释的类型 2 | 3 | 被隐藏的注释 (只有开发人员能够看到): 4 | 5 | < % - - This is a hidden comment - - % > 6 | 7 | 被输出的注释 (用户可以直接通过查看网页源代码看到) : 8 | 9 | < ! - - This is an output comment - - > 10 | -------------------------------------------------------------------------------- /j2ee/what_are_types_of_j2ee_clients.md: -------------------------------------------------------------------------------- 1 | # J2EE客户端有哪些类型? 2 | 3 | * Applets 4 | * Application clients 5 | * Java Web Start-enabled clients, by Java Web Start technology. 6 | * Wireless clients, based on MIDP technology. 7 | -------------------------------------------------------------------------------- /jdbc/what_does_the_classfornamemyclass_do.md: -------------------------------------------------------------------------------- 1 | # What does the Class.forName("MyClass") do? 2 | 3 | Loads the class MyClass. 4 | 5 | Execute any static block code of MyClass. 6 | 7 | Returns an instance of MyClass. 8 | -------------------------------------------------------------------------------- /spring/bf_and_ac.md: -------------------------------------------------------------------------------- 1 | # Bean Factory 与 ApplicationContext 的区别? 2 | 3 | Bean Factory 只提供基础的 DI 支持 4 | 5 | Application contexts 提供了处理 text messages 的功能 6 | 读取 file resources 的功能, 比如图片. 7 | 8 | 发布事件给已经注册为 listener 的 bean. 9 | -------------------------------------------------------------------------------- /sql/inner_join.md: -------------------------------------------------------------------------------- 1 | # inner join 2 | 3 | INNER JOIN 关键字在表中存在至少一个匹配时返回行. 如果没有匹配,就不会列出这些行. 4 | 5 | 例子 6 | 7 | [http://www.w3school.com.cn/sql/sql_join_inner.asp](http://www.w3school.com.cn/sql/sql_join_inner.asp) 8 | 9 | -------------------------------------------------------------------------------- /java/abstraction.md: -------------------------------------------------------------------------------- 1 | # 抽象 2 | 3 | **Abstract 类** 4 | 5 | * 不能实例化 6 | * 至少包含一个抽象方法 7 | 8 | **Abstract 方法** 9 | 10 | * 在父类里定义抽象方法,在子类里定义这个具体的方法,所以它是抽象的. 11 | 12 | **好处** 13 | 14 | 减少复杂度和提高可维护性 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /j2ee/scope_for_the__jsp__usebean__tag_-.md: -------------------------------------------------------------------------------- 1 | # Scope for the < jsp : useBean > tag? 2 | 3 | < jsp : useBean > tag is used to use any java object in the jsp page. 4 | 5 | a) page 6 | b) request 7 | c) session 8 | d) application 9 | -------------------------------------------------------------------------------- /java/when_you_serialize_an_object,_what_happens_to_the_object_references_included_in_the_object.md: -------------------------------------------------------------------------------- 1 | # 序列化时引用的处理? 2 | 3 | When an object is serialized, all the included objects are also serialized alongwith the original object 4 | -------------------------------------------------------------------------------- /hibernate/sorted_and_ordered_collection.md: -------------------------------------------------------------------------------- 1 | # sorted 和 ordered collection 2 | 3 | sorted collection是在内存中通过 java 比较器进行排序的 4 | ordered collection是在数据库中通过 order by 进行排序的 5 | 6 | 建议使用 ordered collection 避免 OutOfMemoryError 问题. 7 | 8 | 9 | -------------------------------------------------------------------------------- /j2ee/what_are_the_phases_of_the_servlet_life_cycle.md: -------------------------------------------------------------------------------- 1 | # servlet 生命周期? 2 | 3 | 1. 读取 Servlet 类 4 | 2. 创建 Servlet 实例 5 | 3. Web 容器调用 Servlet 的 init() 方法 6 | 4. 响应客户端请求通过Servlet中service()方法中相应的doXXX()方法 7 | 5. 调用 Servlet 的 destroy() 8 | -------------------------------------------------------------------------------- /java/encapsulation.md: -------------------------------------------------------------------------------- 1 | # 封装 Encapsulation 2 | 3 | * 使一个类的变量 private 4 | * 提供 public 方法来调用这些变量. 所以外部类是进不去的. 这些变量被隐藏在类里了. 只能通过已经定义的 pulic 方法调用. 5 | 6 | **好处** 7 | 8 | 当我们修改我们的实现的代码时, 不会破坏其他调用我们这部分代码的代码. 9 | 可维护性, 10 | 灵活性和可扩展 11 | -------------------------------------------------------------------------------- /java/what_is_the_common_usage_of_serialization.md: -------------------------------------------------------------------------------- 1 | # 什么情况下要使用序列化? 2 | 3 | Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serilazed. 4 | -------------------------------------------------------------------------------- /java/aaa.md: -------------------------------------------------------------------------------- 1 | # 异常 2 | 3 | 异常是指java程序运行时(非编译)所发生的非正常情况或错误 4 | 5 | Java使用面向对象的方式来处理异常,它把程序中发生的每个异常也都分别封装到一个对象来表示的,该对象中包含有异常的信息 6 | 7 | Java对异常进行了分类,所有异常的根类为java.lang.Throwable 8 | 9 | Throwable下面又派生了两个子类:Error和Exception 10 | 11 | 12 | -------------------------------------------------------------------------------- /java/interfqce_abstraction.md: -------------------------------------------------------------------------------- 1 | # 接口和抽象的区别 2 | 3 | 抽象类可以有构造方法 接口不行 4 | 5 | 抽象类可以有普通成员变量 接口没有 6 | 7 | 抽象类可以有非抽象的方法 接口必须全部抽象 8 | 9 | 抽象类的访问类型都可以 接口只能是 public abstract 10 | 11 | **一个类可以实现多个接口 但只能继承一个抽象类** 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /j2ee/what_are_the_four_components_of_j2ee_application.md: -------------------------------------------------------------------------------- 1 | # J2EE 应用的四个部分? 2 | 3 | 我更喜欢说是层 4 | 5 | * 客户端层 6 | * web层 (Servlet and JSP) 7 | * 业务层 (JavaBeans) 8 | * 企业信息系统层(Enterprise Information System tier) 9 | 或者叫Resource adapter 包含数据库等 10 | -------------------------------------------------------------------------------- /java/interface.md: -------------------------------------------------------------------------------- 1 | # 接口 Interface 2 | 3 | 接口是抽象方法的集合。一个类实现一个或多个接口,因此继承了接口的抽象方法. 4 | 5 | **接口的特点** 6 | 7 | * 不能实例化 8 | * 没有构造体 9 | * 所有方法都是抽象的 (abstract).同时也是隐式的 public. 也就是说声明时, 可以省略 public abstract. 10 | * 只能含有声明为 final static 的 field 11 | -------------------------------------------------------------------------------- /java/what_one_should_take_care_of_while_serializing_the_object.md: -------------------------------------------------------------------------------- 1 | # 序列化时要注意什么? 2 | 3 | One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializableException. 4 | -------------------------------------------------------------------------------- /j2ee/jsp_expressions.md: -------------------------------------------------------------------------------- 1 | # JSP expressions? 2 | 3 | A JSP expression element contains a scripting language expression that is evaluated, converted to a **String**, and inserted where the expression appears in the JSP file. 4 | 5 | <%= expression %> 6 | -------------------------------------------------------------------------------- /java/orient_object.md: -------------------------------------------------------------------------------- 1 | # 面向对象的特征有哪些方面 2 | 3 | 封装 4 | 5 | 让变量和访问这个变量的方法放在一起,将一个类中的成员变量全部定义成私有的,只有这个类自己的方法才可以访问到这些成员变量 6 | 7 | 抽象 8 | 9 | 声明方法的存在而不去实现它的类被叫做抽象类 10 | 11 | 继承 12 | 13 | 继承是子类自动共享父类数据和方法的机制,这是类之间的一种关系,提高了软件的可重用性和可扩展性 14 | 15 | 多态 16 | -------------------------------------------------------------------------------- /java/stream_writer.md: -------------------------------------------------------------------------------- 1 | # 字节流与字符流 2 | 3 | * 字节流继承于InputStream OutputStream 4 | * 字符流继承于InputStreamReader OutputStreamWriter 5 | 6 | 字符流使用了缓冲区 (buffer),而字节流没有使用缓冲区 7 | 8 | 底层设备永远只接受字节数据 9 | 10 | 字符是字节通过不同的编码的包装 11 | 12 | 字符向字节转换时,要注意编码的问题 13 | 14 | -------------------------------------------------------------------------------- /java/final,_finally,_finalize.md: -------------------------------------------------------------------------------- 1 | # final, finally, finalize的区别 2 | 3 | * final 用于声明属性,方法和类, 分别表示属性不可变, 方法不可覆盖, 类不可继承. 4 | 5 | * finally 是异常处理语句结构的一部分,表示总是执行. 6 | 7 | * finalize 是Object类的一个方法,在垃圾收集器执行的时候会调用被回收对象的此方法,可以覆盖此方法提供垃圾收集时的其他资源回收,例如关闭文件等. JVM不保证此方法总被调用. 8 | -------------------------------------------------------------------------------- /java/hashmap_hashtable.md: -------------------------------------------------------------------------------- 1 | # HashMap 和 Hashtable 2 | 3 | Hashtable是基于陈旧的Dictionary类的 4 | HashMap是Java 1.2引进的Map接口的一个实现 5 | 6 | Hashtable是线程安全的,也就是说是同步的 7 | 而HashMap是线程序不安全的,不是同步的 8 | 9 | 只有HashMap可以让你将空值null作为一个表的条目的key或value. 但是 HashTable 不允许 10 | 11 | -------------------------------------------------------------------------------- /java/working_zone.md: -------------------------------------------------------------------------------- 1 | # 作用域的区别 2 | 3 | | 作用域 | 当前类 | 同一个 package | 子孙类 | 其他 package | 4 | | -- | -- | -- | -- | -- | 5 | | public | O| O | O | O | 6 | | protected | O | O | O | X | 7 | | friendly | O | O | X | X | 8 | | private | O | X | X | X | 9 | 10 | -------------------------------------------------------------------------------- /j2ee/creat_servlet.md: -------------------------------------------------------------------------------- 1 | # 创建 servlet 2 | 3 | Servlet 在容器中运行时,其实例的创建及销毁等是由容器进行控制. 4 | 5 | Servlet 的创建有两种方法。 6 | 7 | 1. 客户端请求对应的 Servlet 时,创建 Servlet 实例.大部分Servlet 都是这种 Servlet. 8 | 2. 通过在 web.xml 中设置load-on-startup来创建servlet实例,这种实例在Web 应用启动时,立即创建 Servlet 实例 9 | 10 | -------------------------------------------------------------------------------- /spring/what_are_the_different_modules_in_spring_framework.md: -------------------------------------------------------------------------------- 1 | # Spring 都有哪些模块? 2 | 3 | The Core container module 4 | O/R mapping module (Object/Relational) 5 | DAO module 6 | Application context module 7 | Aspect Oriented Programming 8 | Web module 9 | MVC module 10 | -------------------------------------------------------------------------------- /java/how_to_set_muliti-thread.md: -------------------------------------------------------------------------------- 1 | # 如何实现 muliti-thread? 2 | 3 | * 继续Thread类 4 | * 实现Runable接口 5 | 6 | # Thread 与 Runnable? 7 | 8 | 实现Runnable接口比继承Thread类所具有的优势: 9 | 10 | * 适合多个相同的程序代码的线程去处理同一个资源 11 | 12 | * 可以避免java中的单继承的限制 13 | 14 | * 增加程序的健壮性,代码可以被多个线程共享,代码和数据独 15 | -------------------------------------------------------------------------------- /j2ee/uri_url.md: -------------------------------------------------------------------------------- 1 | # URI 和 URL? 2 | 3 | URIs identify and URLs locate (on network); however, locators are also identifiers. 4 | 5 | So all URLs are URIs (actually not quite - see below), and all URNs are URIs - but URNs and URLs are different, so you can't say that all URIs are URLs. 6 | -------------------------------------------------------------------------------- /spring/which_di.md: -------------------------------------------------------------------------------- 1 | # 你更倾向于哪种 DI 2 | 3 | **采用以设置注入为主,构造注入为辅. 对于依赖关系无须变化的注入, 尽量采用构造注入;而其他的依赖关系的注入, 则采用设置注入.** 4 | 5 | 对于依赖关系无须变化的Bean,构造注入更有用处;因为没有setter方法,所有的依赖关系全部在构造器内设定,因此,不用担心后续代码对依赖关系的破坏.安全性高. 6 | 7 | setter : 创建完对象之后再同过set()方法进行设定. 对于复杂的依赖关系, 如果采用构造注入, 会导致构造器过于臃肿, 难以阅读. 8 | 9 | -------------------------------------------------------------------------------- /j2ee/ear,_jar_and_war_files.md: -------------------------------------------------------------------------------- 1 | # Ear, Jar 和 War 文件的区别? 2 | 3 | * Jar files are intended to hold generic libraries of Java classes, resources, etc. 4 | * War files are intended to contain complete Web applications. 5 | * Ear files are intended to contain complete enterprise applications. 6 | -------------------------------------------------------------------------------- /java/if_i_want_an_object_of_my_class_to_be_thrown_as_an_exception_object,_what_should_i_do.md: -------------------------------------------------------------------------------- 1 | # 如果想要一个对象作为一个异常对象被抛出, 应该怎么做. (就是自己 DIY 一个异常啦) 2 | 3 | 继承 Exception 类. 或者继成功 Exception 类里面的子类, 这样可以更加具体的表明哪一类异常. 4 | 5 | # 如果我的类已经继承了其他的类,那应该怎么做? 6 | 7 | 那就没办法咯. Java 不支持多继承, 目前版本的 JDK 没有相关的接口. 8 | -------------------------------------------------------------------------------- /j2ee/-_transaction.md: -------------------------------------------------------------------------------- 1 | # 什么是事务 - transaction 2 | 3 | 事务是应用程序中一系列严密的操作,所有操作必须成功完成,否则在每个操作中所做的所有更改都会被撤消。例如,将资金从支票帐户转到储蓄帐户中是一项事务,按步骤如下进行: 4 | 5 | 检查支票帐户是否有足够的资金来支付此转帐操作。 6 | 7 | 如果支票帐户中有足够的资金,则将该笔资金记入此帐户的借方。 8 | 9 | 将这些资金记入储蓄帐户的贷方。 10 | 11 | 将此次转帐记录到支票帐户日志中。 12 | 13 | 将此次转帐记录到储蓄帐户日志中。 14 | -------------------------------------------------------------------------------- /java/sleep_and_wait.md: -------------------------------------------------------------------------------- 1 | # sleep() 和 wait() 的区别 2 | 3 | 举个例子 4 | 5 | ``` 6 | sleep(1000)``` 7 | 会把把线程放到一边, 直到**整整**一秒之后才再次启动 8 | 9 | ``` 10 | wait(1000)``` 11 | 12 | 则是把线程放到一边**至多**一秒. 如果碰到 notify() 或者 notifyAll() 就会提前启动. 13 | 14 | 而且 wait() 方法是在 Object 类里. 而 sleep() 是在 Thread 类里. 15 | -------------------------------------------------------------------------------- /java/difference_between_and_symbol.md: -------------------------------------------------------------------------------- 1 | # & 与 && 2 | 3 | 都可以表示逻辑与 and, 但是 && 具有短路功能 第一个表达式错了 第二个就被忽略了。`&` 的表达式是先计算后求与。 4 | 5 | 除此外 & 可以用作位运算符 6 | 7 | `|` 也有类似差异。 8 | 9 | [java - Difference between & and && - Stack Overflow](http://stackoverflow.com/questions/5564410/difference-between-and) 10 | -------------------------------------------------------------------------------- /spring/what_is_dependency_injection.md: -------------------------------------------------------------------------------- 1 | # 什么是依赖注入 - Dependency Injection? 2 | 3 | 反转控制 Inversion of Control (IoC) 或者叫依赖注入 Dependency Injection 4 | 5 | is a general concept, and it can be expressed in many different ways and Dependency Injection is merely one concrete example of Inversion of Control. 6 | -------------------------------------------------------------------------------- /sql/where_having.md: -------------------------------------------------------------------------------- 1 | # Where 和 Having 2 | 3 | WHERE 从句一般是在行的层级去筛选数据 (before grouping). HAVING 从句一般在 GROUP BY 之后所以是在 "groups" 的基础上删选. 4 | 5 | 更准确的说在 SQL 中增加 HAVING 子句原因是 WHERE 关键字无法与合计函数一起使用 6 | 7 | **因为在查询过程中聚合语句(sum,min,max,avg,count)要比having子句优先执行.而where子句在查询过程中执行优先级别优先于聚合语句(sum,min,max,avg,count)** 8 | -------------------------------------------------------------------------------- /j2ee/what_does_application_client_module_contain.md: -------------------------------------------------------------------------------- 1 | # What does application client module contain? 2 | 3 | The application client module contains: 4 | 5 | * class files 6 | * an application client deployment descriptor. 7 | 8 | Application client modules are packaged as JAR files with a .jar extension. 9 | -------------------------------------------------------------------------------- /j2ee/what_is_j2ee.md: -------------------------------------------------------------------------------- 1 | # 什么是 J2EE? 2 | 3 | An environment for developing and deploying enterprise applications. 4 | 5 | The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitier, web-based applications. 6 | -------------------------------------------------------------------------------- /j2ee/what_are_jsp_declarations.md: -------------------------------------------------------------------------------- 1 | # What are JSP declarations? 2 | 3 | A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You must declare the variable or method before you use it in the JSP file. 4 | 5 | <%! declaration; [ declaration; ]+ ... %> 6 | -------------------------------------------------------------------------------- /j2ee/what_does_web_module_contain.md: -------------------------------------------------------------------------------- 1 | # What does web module contain? 2 | 3 | The web module contains: 4 | 5 | * JSP files 6 | * class files for servlets 7 | * GIF and HTML files 8 | * a Web deployment descriptor. 9 | 10 | Web modules are packaged as JAR files with a **.war** (Web ARchive) extension. 11 | -------------------------------------------------------------------------------- /spring/what_is_aop.md: -------------------------------------------------------------------------------- 1 | # 什么是 AOP? 2 | 3 | 面向方面的编程 (Aspect-oriented programming), 4 | 5 | **它可以运行期动态代理实现在不修改源代码的情况下给程序动态统一添加功能的一种技术**. 比如检测某个模块的运行时间. 加入额外的功能 (introduce) 6 | 7 | 下面是专业的所法 : 8 | 9 | 利用AOP可以对业务逻辑的各个部分进行隔离,从而使得业务逻辑各部分之间的耦合度降低,提高程序的可重用性,同时提高了开发的效率 10 | 11 | 主要的功能是:日志记录,性能统计,安全控制,事务处理,异常处理等等。 12 | 13 | 14 | -------------------------------------------------------------------------------- /java/what_ate_object-oriented_features.md: -------------------------------------------------------------------------------- 1 | # 面向对象的特征有哪些方面 2 | 3 | * 封装 4 | 5 | 让变量和访问这个变量的方法放在一起,将一个类中的成员变量全部定义成私有的,只有这个类自己的方法才可以访问到这些成员变量 6 | 7 | * 抽象 8 | 9 | 声明方法的存在而不去实现它的类被叫做抽象类 10 | 11 | * 继承 12 | 13 | 继承是子类自动共享父类数据和方法的机制,这是类之间的一种关系,提高了软件的可重用性和可扩展性 14 | 15 | * 多态 16 | 17 | 多态就是指一个变量, 一个方法或者一个对象可以有不同的形式. 18 | 19 | -------------------------------------------------------------------------------- /sql/leftright_join.md: -------------------------------------------------------------------------------- 1 | # Left/Right join 2 | 3 | LEFT JOIN 关键字会从左表 (table_name1) 那里返回所有的行,即使在右表 (table_name2) 中没有匹配的行. 4 | 5 | [例子](http://www.w3school.com.cn/sql/sql_join_left.asp) 6 | 7 | RIGHT JOIN 关键字会右表 (table_name2) 那里返回所有的行,即使在左表 (table_name1) 中没有匹配的行. 8 | 9 | [例子](http://www.w3school.com.cn/sql/sql_join_right.asp) 10 | -------------------------------------------------------------------------------- /hibernate/what_is_sessionfactory_in_hibernate.md: -------------------------------------------------------------------------------- 1 | # What is SessionFactory in Hibernate? 2 | 3 | SessionFactory 是一个创建 hibernate Session 对象的工厂. 4 | 5 | 它可以作为单一的 data store 及也是线程安全的, 6 | 使多个线程可以使用相同的 SessionFactory. 7 | 8 | 一个 Java JEE 应用只有一个 SessionFactory 如果只有一个数据库的话 9 | 10 | 当创建之后关于 Object/Relational mapping 的元数据是不能改的. 11 | 12 | -------------------------------------------------------------------------------- /j2ee/jsp.md: -------------------------------------------------------------------------------- 1 | 2 | # JSP 3 | 4 | JavaServer Pages (JSP) 5 | 6 | delivering **dynamic content** to web applications in a portable, secure and well-defined way. 7 | 8 | The JSP Technology allows us to use HTML, Java, JavaScript and XML in a single file to create high quality and fully functionaly User Interface components for Web Applications. 9 | -------------------------------------------------------------------------------- /java/externalizable_interface.md: -------------------------------------------------------------------------------- 1 | # Externalizable 接口? 2 | 3 | Externalizable is an interface which contains two methods readExternal and writeExternal. These methods give you a control over the serialization mechanism. Thus if your class implements this interface, you can customize the serialization process by implementing these methods. 4 | -------------------------------------------------------------------------------- /java/string_object.md: -------------------------------------------------------------------------------- 1 | # 创建了几个String Object?二者之间有什么区别? 2 | 3 | String s = new String("xyz"); 4 | 5 | 两个或一个, 6 | ”xyz”对应一个对象, 7 | 这个对象放在字符串常量缓冲区, 8 | 常量”xyz”不管出现多少遍, 9 | 都是缓冲区中的那一个. 10 | New String每写一遍, 11 | 就创建一个新的对象, 12 | 它一句那个常量”xyz”对象的内容来创建出一个新String对象. 13 | 如果以前就用过’xyz’, 14 | 这句代表就不会创建”xyz”自己了, 15 | 直接从缓冲区拿. 16 | 17 | 18 | -------------------------------------------------------------------------------- /java/static_wya.md: -------------------------------------------------------------------------------- 1 | # 一个 static 方法内部调用非 static 方法? 2 | 3 | 不可以 4 | 5 | 因为非 static 方法是要与对象关联在一起的, 须创建一个对象后,才可以在该对象上进行方法调用, 6 | 而static方法调用时不需要创建对象, 7 | 可以直接调用. 8 | 也就是说, 9 | 当一个 static 方法被调用时, 10 | 可能还没有创建任何实例对象, 11 | 如果从一个 static 方法中发出对非 static 方法的调用, 12 | 那个非 static 方法是关联到哪个对象上的呢?这个逻辑无法成立, 13 | 所以, 14 | 一个 static 方法内部发出对非 static 方法的调用. 15 | -------------------------------------------------------------------------------- /jdbc/stored_procedure_and_how_do_you_call_it_in_jdbc.md: -------------------------------------------------------------------------------- 1 | # Stored Procedure? 2 | 3 | A stored procedure is a group of SQL statements that form a logical unit and perform a particular task. (粗俗的可以理解为一个定义好的方法, 提供输入就会得到对应的输出) 4 | 5 | CallableStatement cs = con.prepareCall("{call MY_SAMPLE_STORED_PROC}"); 6 | ResultSet rs = cs.executeQuery(); 7 | -------------------------------------------------------------------------------- /j2ee/types_of_directive_tags.md: -------------------------------------------------------------------------------- 1 | # Types of directive tags? 2 | 3 | <%@ page ... %> : Defines page-dependent attributes, such as scripting language, error page, and buffering requirements. 4 | 5 | <%@ include ... %> : Includes a file during the translation phase. 6 | 7 | <%@ taglib ... %> : Declares a tag library, containing custom actions, used in the page. 8 | -------------------------------------------------------------------------------- /j2ee/what_is_hibernate.md: -------------------------------------------------------------------------------- 1 | # Hibernate是什么? 2 | 3 | * object-relational 4 | * 5 | * In hibernate we can write HQL instead of SQL which save developers to spend more time on writing the native SQL. 6 | 7 | * 我们能像处理 Java 对象一样处理数据库 8 | * 所以可以在处理的时候加入 Java 语言的特性 比如继承啊 多态啊 。。 9 | 10 | * Hibernate also allows you to express queries using java-based criteria . 11 | -------------------------------------------------------------------------------- /java/string_question.md: -------------------------------------------------------------------------------- 1 | # 执行后,原始的String对象中的内容到底变了没有? 2 | 3 | String s = "Hello"; 4 | s = s + " world!"; 5 | 6 | 没有. 7 | 因为String被设计成不可变(immutable)类, 8 | 所以它的所有对象都是不可变对象. 9 | 10 | 在这段代码中, 11 | s原先指向一个String对象, 12 | 内容是 "Hello",然后我们对s进行了+操作, 13 | 这时,s不指向原来那个对象了, 14 | 而指向了另一个 String对象, 15 | 内容为"Hello world!", 16 | 原来那个对象还存在于内存之中, 17 | 只是s这个引用变量不再指向它了. 18 | -------------------------------------------------------------------------------- /scrum/README.md: -------------------------------------------------------------------------------- 1 | # Scrum 2 | 3 | * 迭代式开发 Le développement itératif 4 | * 以人为核心 5 | 6 | 为什么说是以人为核心? 7 | 8 | 我们大部分人都学过瀑布开发模型,它是以文档为驱动的,为什么呢?因为在瀑布的整个开发过程中,要写大量的文档,把需求文档写出来后,开发人员都是根据文档进行开发的,一切以文档为依据;而敏捷开发它只写有必要的文档,或尽量少写文档,敏捷开发注重的是人与人之间,面对面的交流,所以它强调以人为核心。 9 | 10 | 11 | 什么是迭代? 12 | 13 | 迭代是指把一个复杂且开发周期很长的开发任务,分解为很多小周期可完成的任务,这样的一个周期就是一次迭代的过程;同时每一次迭代都可以生产或开发出一个可以交付的软件产品。 14 | -------------------------------------------------------------------------------- /spring/how_can_you_inject_java_collection_in_spring.md: -------------------------------------------------------------------------------- 1 | # How can you inject Java Collection in Spring? 2 | 3 | : injecting a list of values, 允许重复. 4 | 5 | : This helps in wiring a set of values 不允许重复. 6 | 7 | : name-value pairs where name and value can be of any type. 8 | 9 | :name-value pairs where the name and value are both Strings. 10 | -------------------------------------------------------------------------------- /java/heap_stack.md: -------------------------------------------------------------------------------- 1 | # heap 和 stack 2 | 3 | java的内存分为两类 : 4 | 5 | * 堆内存 heap 6 | * 栈内存 stack 7 | 8 | 9 | stack 是指程序进入一个方法时, 10 | 会为这个方法单独分配一块私属存储空间, 11 | 用于存储这个方法内部的局部变量, 12 | 当这个方法结束时, 13 | 分配给这个方法的栈会释放, 14 | 这个栈中的变量也将随之释放. 15 | 16 | heap 一般用于存放不放在当前方法栈中的那些数据, 17 | 例如, 18 | 使用 new 创建的对象都放在堆里, 19 | 所以, 20 | 它不会随方法的结束而消失. 21 | 方法中的局部变量使用 final 修饰后, 22 | 放在堆中, 23 | 而不是栈中. 24 | 25 | -------------------------------------------------------------------------------- /sql/what_type_of_wildcards_have_you_used.md: -------------------------------------------------------------------------------- 1 | # What type of wildcards have you used? 2 | 3 | 首先说下什么是 wildcards 4 | 5 | Wildcards are special characters that allow matching string without having exact match. 6 | 7 | SQL 通配符必须与 LIKE 运算符一起使用 8 | 9 | % 替代一个或多个字符 10 | 11 | _ 仅替代一个字符 12 | 13 | [charlist] 字符列中的任何单一字符 14 | 15 | [^charlist] 16 | 或者 17 | [!charlist] 18 | 不在字符列中的任何单一字符 19 | -------------------------------------------------------------------------------- /java/reflection.md: -------------------------------------------------------------------------------- 1 | # 反射机制 2 | 3 | JAVA反射机制是在运行状态中, 对于任意一个类, 都能够知道这个类的所有属性和方法; 对于任意一个对象, 都能够调用它的任意一个方法和属性; 这种动态获取的信息以及动态调用对象的方法的功能称为java语言的反射机制. 4 | 5 | 主要作用有三: 6 | 7 | 1. 运行时取得类的方法和字段的相关信息。 8 | 2. 创建某个类的新实例(.newInstance()) 9 | 3. 取得字段引用直接获取和设置对象字段,无论访问修饰符是什么。 10 | 11 | 用处如下: 12 | 13 | 1. 观察或操作应用程序的运行时行为。 14 | 2. 调试或测试程序,因为可以直接访问方法、构造函数和成员字段。 15 | 3. 通过名字调用不知道的方法并使用该信息来创建对象和调用方法。 16 | -------------------------------------------------------------------------------- /java/what_kind_of_variables_a_class_can_consist_of.md: -------------------------------------------------------------------------------- 1 | # 一个类是由哪些变量构成的? 2 | 3 | * Local variable 本地变量 4 | * instance variables 实例变量 5 | * class variables 类变量 6 | 7 | **Local variable** 8 | 9 | 在方法体, 构造体内部定义的变量 10 | 在方法结束的时候就被摧毁 11 | 12 | **instance variables** 13 | 14 | 在类里但是不在方法里 15 | 在类被载入的时候被实例化 16 | 17 | **class variables** 18 | 19 | 在类里但在方法外, 20 | 加了 static 关键字. 21 | 也可以叫做静态变量 22 | -------------------------------------------------------------------------------- /spring/autowired_inject_resource.md: -------------------------------------------------------------------------------- 1 | # @Autowired @Inject @Resource 2 | 3 | @Autowired and @Inject 4 | 5 | Matches by Type 6 | Restricts by Qualifiers 7 | Matches by Name 8 | 9 | AutowiredAnnotationBeanPostProcessor 10 | 11 | @Resource 12 | 13 | Matches by Name 14 | Matches by Type 15 | Restricts by Qualifiers 16 | 17 | CommonAnnotationBeanPostProcessor 18 | -------------------------------------------------------------------------------- /scrum/scrum_chara.md: -------------------------------------------------------------------------------- 1 | # Scrum 中的三大角色 2 | 3 | * 产品负责人(Product Owner) 4 | 5 | 主要负责确定产品的功能和达到要求的标准,指定软件的发布日期和交付的内容,同时有权力接受或拒绝开发团队的工作成果。 6 | 7 | * 流程管理员(Scrum Master) 8 | 9 | 主要负责整个Scrum流程在项目中的顺利实施和进行,以及清除挡在客户和开发工作之间的沟通障碍,使得客户可以直接驱动开发。 10 | 11 | * 开发团队(Scrum Team) 12 | 13 | 主要负责软件产品在Scrum规定流程下进行开发工作,人数控制在5~10人左右,每个成员可能负责不同的技术方面,但要求每成员必须要有很强的自我管理能力,同时具有一定的表达能力;成员可以采用任何工作方式,只要能达到Sprint的目标。 14 | 15 | 16 | -------------------------------------------------------------------------------- /java/what_is_the_difference_between_preemptive_scheduling_and_time_slicing.md: -------------------------------------------------------------------------------- 1 | # preemptive scheduling 和 time slicing? 2 | 3 | preemptive scheduling, 4 | 优先级别最高的任务会被执行, 5 | 除非它进入等待状态或者死了或者一个更高优先权的任务进来. 6 | 7 | time slicing, 8 | a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors. 9 | -------------------------------------------------------------------------------- /java/what_do_you_know_about_java.md: -------------------------------------------------------------------------------- 1 | # 说一说 Java 2 | 3 | Sun 公司在 1995 创建 4 | 5 | Java 的一些特点? 6 | 7 | * Object Oriented 面向对象 8 | * Platform Independent 平台独立 9 | * Interpreted 解释性语言 10 | * Multi-threaded 多线程 11 | 12 | 但是 Java 最重要的特点是**平台独立** 13 | 14 | 平台独立意味着我们可以在一个系统编译它然后在另外一个系统使用它 15 | 16 | PS : 有一些中文的博客会说 java 也是编译性语言 因为国内博客都是你抄我 我抄你 所以你懂的 当然最好就是给出编译混合解释性这个说法 然后给出自己的理解 我自己在国外面试的时候也问了几个面试官关于这个问题 都说解释性语言是最准确的. 17 | -------------------------------------------------------------------------------- /java/what_happens_to_the_static_fields_of_a_class_during_serialization.md: -------------------------------------------------------------------------------- 1 | # 序列化时 static 域的处理? 2 | 3 | There are three exceptions in which serialization doesnot necessarily read and write to the stream. These are 4 | 5 | 1. Serialization ignores static fields, because they are not part of auy particular state state. 6 | 2. Base class fields are only hendled if the base class itself is serializable. 7 | 3. Transient fields. 8 | -------------------------------------------------------------------------------- /j2ee/what_do_you_understand_by_jsp_actions.md: -------------------------------------------------------------------------------- 1 | # What do you understand by JSP Actions? 2 | 3 | JSP actions are XML tags that direct the server to use existing components or control the behavior of the JSP engine. 4 | 5 | There are six JSP Actions: 6 | 7 | * < jsp : include / > 8 | * < jsp : forward / > 9 | * < jsp : plugin / > 10 | * < jsp : usebean / > 11 | * < jsp : setProperty / > 12 | * < jsp : getProperty / > 13 | -------------------------------------------------------------------------------- /java/how_can_i_customize_the_seralization_process_ie_how_can_one_have_a_control_over_the_serialization_process.md: -------------------------------------------------------------------------------- 1 | # 如何控制 serialization 的过程? 2 | 3 | Yes it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal and writeExternal. You should implement these methods and write the logic for customizing the serialization process. 4 | -------------------------------------------------------------------------------- /j2ee/jspforward_page=___responsesendredirecturl.md: -------------------------------------------------------------------------------- 1 | # 和 response.sendRedirect(url)? 2 | 3 | jsp:forward 把 request object 传递给服务器里的另外一个 servlet 或者 JSP. 新的 servlet 或者 JSP 继续处理同一个 request and the 但浏览器并不知道这些. 在浏览器里的 URL 不变. 4 | 5 | response.sendRedirect() 创建了一个新的 request object, 不携带旧的 request object 的信息. The first request handler JSP page tells the browser to make a new request to the target servlet or JSP page. 在浏览器里的 URL 改变. 6 | -------------------------------------------------------------------------------- /spring/spring_bean_scope.md: -------------------------------------------------------------------------------- 1 | # 都有哪些 bean scope? 2 | 3 | * singleton: Return a single bean instance per Spring IoC container 4 | 5 | * prototype: Return a new bean instance each time when requested 6 | 7 | * request: Return a single bean instance per HTTP request 8 | 9 | * session: Return a single bean instance per HTTP session 10 | 11 | * global-session: Return a single bean instance per global HTTP session 12 | 13 | **默认的是 singleton** 14 | 15 | -------------------------------------------------------------------------------- /sql/union.md: -------------------------------------------------------------------------------- 1 | # 合并 2 | 3 | How can you combine two tables/views together? For instance one table contains 100 rows and the other one contains 200 rows, have exactly the same fields and you want to show a query with all data (300 rows). 4 | 5 | SELECT column_name FROM table_name1 6 | UNION 7 | SELECT column_name FROM table_name2 8 | 9 | 注意 10 | 11 | * UNION 内部的 SELECT 语句必须拥有相同数量的列. 12 | * 列也必须拥有相似的数据类型. 13 | * 每条 SELECT 语句中的列的顺序必须相同. 14 | -------------------------------------------------------------------------------- /java/array.md: -------------------------------------------------------------------------------- 1 | # 数组相关问题 2 | 3 | **题目一** 4 | 5 | Which of the following are valid array declaration for srings of 50 chars? 6 | 7 | A. char c[][]; 8 | B. String []s; 9 | C. String s[50]; 10 | D. Object s[50]; 11 | 12 | 答案 B 13 | 14 | int [][] iArray; 15 | int []iArray[]; 16 | intt iArray[][]; 17 | 18 | 都是可以得, 但数组不能直接指定列数或者行数. 正确的方式应该在创建数组对象是. 19 | 20 | 比如 21 | 22 | int iArray[][] = new int[3][4] 23 | 24 | **题目二** 25 | -------------------------------------------------------------------------------- /jdbc/what_is_difference_between_statement_and_prepared_statement.md: -------------------------------------------------------------------------------- 1 | # statement 和 prepared statement? 2 | 3 | 4 | Statement每次执行sql语句,数据库都要执行sql语句的编译. 5 | 最好用于仅执行一次查询并返回结果的情形,效率高于PreparedStatement. 6 | 7 | Prepared statements offer better performance, as they are **pre-compiled**. Use when you plan to use the SQL statements **many times**. 8 | 9 | Prepared statements are more secure because they use bind variables, which can prevent SQL injection attack. 10 | -------------------------------------------------------------------------------- /java/stringbuffer_questions.md: -------------------------------------------------------------------------------- 1 | # StringBuffer 相关问题 2 | 3 | **题目一** 4 | 5 | StringBuffer 和 StringBuilder 6 | 7 | * StringBuilder 比 StringBuffer 快 8 | * 当需要保证线程安全的时候用 StringBuffer 9 | * StringBuffer 是 synchronized, StringBuilder 不是. 10 | 11 | String 类一般被认为是不可改变的. 12 | 如果需要对一个String做许多修改就需要使用StringBuffer或者StringBuilder. 13 | 14 | 在Oracle里的定义就是 15 | "A mutable sequence of characters." 16 | 17 | 另外需要注意 String 类是 final 类不可以被继承. 有时候会在考察 final 关键字的时候考这个. 18 | 19 | 20 | -------------------------------------------------------------------------------- /java/what_is_daemon_thread_and_which_method_is_used_to_create_the_daemon_thread.md: -------------------------------------------------------------------------------- 1 | # 守护线程 daemon thread? 2 | 3 | 守护线程, 4 | 是指在程序运行的时候在后台提供一种通用服务的线程, 5 | 比如垃圾回收线程就是一个很称职的守护者, 6 | 并且这种线程并不属于程序中不可或缺的部分. 7 | 因此, 8 | 当所有的非守护线程结束时, 9 | 程序也就终止了, 10 | 同时会杀死进程中的所有守护线程. 11 | 反过来说, 12 | 只要任何非守护线程还在运行, 13 | 程序就不会终止. 14 | 15 | 用户线程和守护线程两者几乎没有区别, 16 | 唯一的不同之处就在于虚拟机的离开: 17 | 如果用户线程已经全部退出运行了, 18 | 只剩下守护线程存在了, 19 | 虚拟机也就退出了. 20 | 21 | 将线程转换为守护线程可以通过调用Thread对象的setDaemon(true)方法来实现. 22 | -------------------------------------------------------------------------------- /spring/types_of_advice.md: -------------------------------------------------------------------------------- 1 | # 通知的类型? 2 | 3 | before: Run advice before the a method execution. 4 | 5 | after: Run advice after the a method execution regardless of its outcome. 6 | 7 | after-returning: Run advice after the a method execution only if method completes successfully. 8 | 9 | after-throwing: Run advice after the a method execution only if method exits by throwing an exception. 10 | 11 | around: Run advice before and after the advised method is invoked. 12 | -------------------------------------------------------------------------------- /jdbc/connection_pooling.md: -------------------------------------------------------------------------------- 1 | # Connection Pooling ? 2 | 3 | Connection Pooling is a technique used for reuse of physical connections and reduced overhead for your application. 4 | 5 | Connection pooling functionality minimizes expensive operations in the creation and closing of sessions. 6 | 7 | Database vendor's help multiple clients to share a cached set of connection objects that provides access to a database. Clients need not create a new connection every time to interact with the database. 8 | -------------------------------------------------------------------------------- /java/checked_exception.md: -------------------------------------------------------------------------------- 1 | # Checked 异常与 Runtime 异常 2 | 3 | 4 | * Runtime exceptions 是 runtime 阶段碰到的异常. 在编译的时候不需要检查 (checked). 例如, 5 | 数组脚本越界(ArrayIndexOutOfBoundsException) , 6 | 空指针异常(NullPointerException), 7 | 类转换异常(ClassCastException). 8 | 9 | * Checked exception 是在编译阶段的异常,并且强制检查. 10 | 11 | 编译器**强制 checked 异常必须try..catch处理或用throws声明**继续抛给上层调用方法处理, 12 | 这就是为什么叫**checked异常**, 13 | 而 Runtime 异常可以处理也可以不处理, 14 | 所以, 15 | 编译器不强制用try..catch处理或用throws声明, 16 | 所以 Runtime 异常也称为unchecked异常 17 | 18 | -------------------------------------------------------------------------------- /java/static.md: -------------------------------------------------------------------------------- 1 | # Static 关键字 2 | 3 | Static 关键字表明一个成员变量或者是成员方法可以在没有所属的类的实例的情况下直接被访问 4 | 5 | 声明为 **static 的方法**有以下几条限制: 6 | 7 | 1. 仅能调用其他的 static 方法 8 | 2. 只能访问 static 变量. 9 | 3. 不能以任何方式引用 this 或 super 10 | 4. 不能被覆盖. 11 | 12 | 声明为 **static 的变量**实质上就是全局变量. 13 | (+ final 就是全局**常**量). 14 | 当声明一个对象时, 15 | 并不产生 static 变量的拷贝, 16 | 而是该类所有的实例变量共用同一个 static 变量. 17 | 18 | 对于静态类,只能用于嵌套类内部类中。 19 | 20 | ## Reference 21 | 22 | - [Static class in Java - GeeksforGeeks](http://www.geeksforgeeks.org/static-class-in-java/) 23 | -------------------------------------------------------------------------------- /java/what_are_synchronized_methods_and_synchronized_statements.md: -------------------------------------------------------------------------------- 1 | # synchronized method 和 synchronized statement? 2 | 3 | Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement. 4 | -------------------------------------------------------------------------------- /java/article11.md: -------------------------------------------------------------------------------- 1 | # Article11 2 | 3 | How could Java classes direct program messages to the system console, but error messages, say to a file? 4 | 5 | 6 | The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed: 7 | 8 | Stream st = new Stream(new FileOutputStream("output.txt")); 9 | 10 | System.setErr(st); 11 | System.setOut(st); 12 | -------------------------------------------------------------------------------- /java/supergetclass.md: -------------------------------------------------------------------------------- 1 | # super.getClass() 2 | 3 | import java.util.Date; 4 | 5 | public class Test extends Date{ 6 | 7 | public static void main(String[] args) { 8 | new Test().test(); 9 | } 10 | 11 | public void test(){ 12 | System.out.println(super.getClass().getName()); 13 | } 14 | } 15 | 16 | 返回的结果是 Test 17 | 18 | 因为super.getClass().getName() 调用了父类的 getClass() 方法, 返回当前类 19 | 20 | 如果想得到父类的名称,应该用如下代码: 21 | 22 | getClass().getSuperClass().getName() 23 | -------------------------------------------------------------------------------- /java/gabage_collection.md: -------------------------------------------------------------------------------- 1 | # Gabage Collection 2 | 3 | **什么是GC** 4 | 5 | GC是垃圾收集的意思(Gabage Collection), 6 | 内存处理是编程人员容易出现问题的地方, 7 | 忘记或者错误的内存回收会导致程序或系统的不稳定甚至崩溃, 8 | Java提供的GC功能可以自动监测对象是否超过作用域从而达到自动回收内存的目的, 9 | Java语言没有提供释放已分配内存的显示操作方法. 10 | 11 | **垃圾回收器的基本原理是什么?** 12 | 13 | 当程序员创建对象时,GC就开始监控这个对象的 地址、大小以及使用情况. 14 | 通常,GC采用有向图的方式记录和管理堆(heap)中的所有对象。通过这种方式确定哪些对象是"可达的", 哪些对象是"不可达的".当GC确定一些对象为"不可达"时(比如设置为 null),GC就有责任回收这些内存空间. 15 | 16 | **有什么办法主动通知虚拟机进行垃圾回收?** 17 | 18 | 可以.程序员可以手动执行System.gc(),通知GC运行,但是Java语言规范并不保证GC一定会执行. 这个选择题的时候有考. 19 | -------------------------------------------------------------------------------- /jdbc/what_are_the_steps_in_the_jdbc_connection.md: -------------------------------------------------------------------------------- 1 | # What are the steps in the JDBC connection? 2 | 3 | Step 1 : Register the database driver by using : 4 | Class.forName(\" driver classs for that specific database\" ); 5 | 6 | Step 2 : Now create a database connection using : 7 | 8 | Connection con = DriverManager.getConnection(url,username,password); 9 | 10 | Step 3: Now Create a query using : 11 | 12 | Statement stmt = Connection.Statement(\"select * from TABLE NAME\"); 13 | 14 | Step 4 : Exceute the query : 15 | 16 | stmt.exceuteUpdate(); 17 | -------------------------------------------------------------------------------- /java/question_interface_1.md: -------------------------------------------------------------------------------- 1 | # 基础概念题 2 | 3 | 下面哪一项说法是正确的 4 | 5 | 1. 在一个子类里,一个方法不是 public 就不能重载 6 | 2. 覆盖一个方法只需要满足相同的方法名和参数类型 7 | 3. 覆盖一个方法必须方法名,参数和返回类型都相同 8 | 4. 一个覆盖的方法必须有相同的方法名,参数名和参数类型 9 | 10 | 答案 3 11 | 12 | 覆盖函数与被覆盖函数只有函数体不同 13 | 14 | 下面哪一项说法是错误的 15 | 16 | 1. 重载函数的函数名必须相同 17 | 2. 重载函数必须在参数个数或类型上有所不同 18 | 3. 重载函数的返回值必须相同 19 | 4. 重载函数的函数体可以不同 20 | 21 | 答案 3 22 | 23 | 函数的重载与函数的返回值无关 24 | 25 | 下面哪一项说法是正确的 26 | 27 | 1. 静态方法不能被覆盖 28 | 2. 静态方法不能被声明称私有 29 | 3. 私有方法不能被重载 30 | 4. 一个重载的方法在基类中不通过检查不能抛出异常 31 | 32 | 答案 1 33 | 34 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /java/static_questions.md: -------------------------------------------------------------------------------- 1 | # Static 相关问题 2 | 3 | ### Static 关键字是什么意思? 4 | 5 | Static 关键字表明一个成员变量或者是成员方法可以在没有所属的类的实例的情况下直接被访问 6 | 7 | ### 是否可以 override 一个 static 的方法? 8 | 9 | 不能被覆盖. 因为方法覆盖是基于运行时动态绑定的, 而 static 方法是编译时静态绑定的. 10 | 11 | ### 一个 static 方法内部调用非 static 方法? 12 | 13 | 不可以. 因为非 static 方法是要与对象关联在一起的, 须创建一个对象的实例后, 才可以在该对象上进行方法调用, 14 | 而static方法调用时不需要创建对象, 可以直接调用. 也就是说, 15 | 当一个 static 方法被调用时, 可能还没有创建任何实例对象, 16 | 如果从一个 static 方法中发出对非 static 方法的调用, 那个非 static 方法是关联到哪个对象上的呢? 这个逻辑无法成立, 17 | 所以, 一个 static 方法内部发出对非 static 方法的调用. 18 | 19 | ### 是否可以在 static 环境中访问非 static 变量? 20 | 21 | 同上 22 | -------------------------------------------------------------------------------- /java/synchronized.md: -------------------------------------------------------------------------------- 1 | # 同步 synchronized 2 | 3 | 举个例子 4 | 5 | public class Synchronized Counter { 6 | private int c = 0; 7 | 8 | public synchronized void increment() { 9 | c++; 10 | } 11 | 12 | public synchronized void decrement() { 13 | c--; 14 | } 15 | 16 | public synchronized int value() { 17 | return c; 18 | } 19 | } 20 | 21 | 如果 count 是这个类的实例化将有两个效果: 22 | 23 | * 不可能同时调用同一个对象的同一个方法, 防止造成冲突.同一时间只有一个线程可以调用这对象的同步方法.比如在一个账户里同时存钱和转账. 24 | 25 | * 当一个同步方法退出时, 26 | *它会和随后一个同步方法的调用自动建立happens-before关系. 这保证了所有线程都知道对象的状态改变了. 27 | 28 | -------------------------------------------------------------------------------- /java/synchroniz.md: -------------------------------------------------------------------------------- 1 | # 同步 synchronized 2 | 3 | 举个例子 4 | 5 | public class Synchronized Counter { 6 | private int c = 0; 7 | 8 | public synchronized void increment() { 9 | c++; 10 | } 11 | 12 | public synchronized void decrement() { 13 | c--; 14 | } 15 | 16 | public synchronized int value() { 17 | return c; 18 | } 19 | } 20 | 21 | 如果 count 是这个类的实例化将有两个效果: 22 | 23 | * 不可能同时调用同一个对象的同一个方法, 防止造成冲突.同一时间只有一个线程可以调用这对象的同步方法.比如在一个账户里同时存钱和转账. 24 | 25 | * 当一个同步方法退出时,它会和随后一个同步方法的调用自动建立happens-before关系。这保证了所有线程都知道对象的状态改变了。 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sql/README.md: -------------------------------------------------------------------------------- 1 | # SQL 2 | 3 | 数据库管理系统在写入/更新资料过程中为保证事务是正确可靠的,其必须具备 ACID 特性。 4 | 5 | ## ACID 6 | 7 | - A: atomicity(原子性) - 一个事务(transaction)中的所有操作,要么全部完成,要么全部不完成,不会结束在中间某个环节。事务在执行过程中发生错误,会被回滚(Rollback)到事务开始前的状态,就像这个事务从来没有执行过一样。 8 | - C: consistency(一致性) - 在事务开始之前和事务结束以后,数据库的完整性没有被破坏。即从一个一致性状态转换到另一个一致性状态。 9 | - I: isolation(隔离性) - 当两个或者多个事务并发访问(此处访问指查询和修改的操作)数据库的同一数据时所表现出的相互关系。通常来说,一个事务所做的修改在最终提交以前,对其他事务是不可见的。 10 | - D: durability(持久性) - 在事务完成以后,该事务对数据库所作的更改便持久地保存在数据库之中,并且是完全的。 11 | 12 | 符合 ACID 的典型例子有银行转账,整个过程称为一个事务,具有 ACID 特性。 13 | 14 | ## Reference 15 | 16 | - [ACID - 维基百科,自由的百科全书](https://zh.wikipedia.org/wiki/ACID) 17 | - 《高性能 MySQL》 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java 面试笔记 2 | 3 | 这本书其实是我的一本笔记 (还在整理中). 我是也是刚找到工作. 这本笔记主要记录了我之前面试遇到的问题以及我在网上整理的一些资料 主要是面向 junior 级别的 就是我们这些小菜鸟啦 ~ 4 | 5 | 目前只有我一个人 希望大家都能加入进来一起贡献或者是指出错误 6 | 7 | 如果有确实帮助到大家 可以进我的源代码在右上角 star 一下下 :) 8 | 9 | [Gitbook地址](https://dongchuan.gitbooks.io/java-interview-question/content/) 10 | 11 | [Github托管地址](https://github.com/DONGChuan/Java_Interview_question) 12 | 13 | ---- 14 | ### 如何贡献 15 | 16 | 任何问题都欢迎直接联系我 dongchuanyz@163.com QQ 526402328 17 | 18 | 因为现在 gitbook 支持在线编辑功能. 所以想要贡献的同学可以直接联系我开权限! 19 | 20 | ---- 21 | ### 许可证 22 | 23 | 该项目采用 **知识共享署名-相同方式共享 4.0 国际许可协议** 进行许. 传播此文档时请注意遵循以上许可协议. 关于本许可证的更多详情可参考 http://creativecommons.org/licenses/by-sa/4.0/ 24 | -------------------------------------------------------------------------------- /java/hashmap_hashtable_linkedhashmap_treemap.md: -------------------------------------------------------------------------------- 1 | # HashMap HashTable LinkedHashMap TreeMap 2 | 3 | 不允许键重复,值可以重复。 4 | 5 | HashMap是一个最常用的Map, 它根据键的hashCode值存储数据, 6 | 根据键可以直接获取它的值, 7 | 具有很快的访问速度. 8 | HashMap最多只允许一条记录的键为null, 9 | 不允许多条记录的值为null. 10 | HashMap不支持线程的同步, 11 | 如果需要同步, 12 | 可以用Collections.synchronizedMap(HashMap map)方法使HashMap具有同步的能力. 13 | 14 | Hashtable与HashMap类似, 15 | 不同的是: 16 | 它不允许记录的键或者值为空; 17 | 它支持线程的同步. 18 | 19 | LinkedHashMap保存了记录的插入顺序, 20 | 在用Iteraor遍历LinkedHashMap时, 21 | 先得到的记录肯定是先插入的. 22 | 在遍历的时候会比HashMap慢. 23 | 有HashMap的全部特性. 24 | 25 | TreeMap能够把它保存的记录根据键排序, 26 | 默认是按升序排序, 27 | 也可以指定排序的比较器. 28 | 当用Iteraor遍历TreeMap时, 29 | 得到的记录是排过序的. 30 | TreeMap的键和值都不能为空. 31 | -------------------------------------------------------------------------------- /java/equals_and_==.md: -------------------------------------------------------------------------------- 1 | # equals 与 == 2 | 3 | * == 比较对象的引用 4 | * equals 比较对象的值 5 | 6 | **题目一** 7 | ``` 8 | public class Test{ 9 | public static void main(String[] args){ 10 | String s1 = "abc"; 11 | String s2 = s1; 12 | String s3 = new String("abc"); 13 | String s4 = new String("abc"); 14 | String s5 = "abc"; 15 | 16 | System.out.println(s1==s5); 17 | System.out.println(s1==s2); 18 | System.out.println(s1.equals(s2)); 19 | System.out.println(s3==s4); 20 | System.out.println(s1.equals(s4)); 21 | System.out.println(s3.equals(s4)); 22 | } 23 | }``` 24 | 25 | 输出是 true true true false true true 26 | -------------------------------------------------------------------------------- /java/serialization.md: -------------------------------------------------------------------------------- 1 | # 序列化 serialization 2 | 3 | Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream. 4 | 5 | JAVA中实现serialization主要靠两个类: 6 | 7 | * ObjectOuputStream 8 | * ObjectInputStream 9 | 10 | 他们是JAVA IO系统里的OutputStream和InputStream的子类 11 | 12 | 自定义序列化的作用如下: 13 | 14 | 1. Persist only meaningful data. 15 | 2. Manage serialization between different versions of your class. 16 | 3. Avoid exposing the serialization mechanism to client API. 17 | 18 | ## Reference 19 | 20 | - [The Java HotSpot: Customizing Java Serialization [Part 2]](http://javawithswaranga.blogspot.com/2011/09/customizing-java-serialization-part-2.html) 21 | -------------------------------------------------------------------------------- /java/what_is_singleton_class.md: -------------------------------------------------------------------------------- 1 | # Singleton 单例模式 2 | 3 | Java中单例模式定义:“一个类有且仅有一个实例,并且自行实例化向整个系统提供。” 4 | 5 | ```java 6 | public class Singleton { 7 | private Singleton() { 8 | // do something 9 | } 10 | private static class SingletonHolder { 11 | private static final Singleton INSTANCE = new Singleton(); 12 | } 13 | public static final Singleton getInstance() { 14 | return SingletonHolder.INSTANCE; 15 | } 16 | } 17 | ``` 18 | 19 | 多选题注意 20 | * 一是单例模式的类只提供私有的构造函数 21 | * 二是类定义中含有一个该类的静态私有对象 22 | * 三是该类提供了一个静态的公有的函数用于创建或获取它本身的静态私有对象。 23 | 24 | ## Reference 25 | 26 | - [深入浅出单实例Singleton设计模式 | 酷壳 - CoolShell.cn](http://coolshell.cn/articles/265.html) 27 | -------------------------------------------------------------------------------- /java/initialization_and_cleanup.md: -------------------------------------------------------------------------------- 1 | # Initialization and Cleanup 2 | # Initialization and Cleanup 3 | 4 | # 5. 初始化和清理 5 | 6 | ## 5.7 构造器初始化 7 | 8 | ### 5.7.1 初始化顺序 9 | 10 | 类内部变量定义的先后顺序决定了其初始化的顺序,并且会在任何方法(包括构造器,与顺序无关)被调用之前也会得到初始化。对于静态对象与非静态对象:先初始化静态对象,然后是非静态对象。 11 | 12 | ### 5.7.2 静态数据的初始化 13 | 14 | 静态数据只占用一份存储区域,static 关键字不能用于局部变量,因为它只能作用于域。如果一个域是静态的基本类型域且未对其初始化,那么它就会获得基本类型的标准初值;如果是一个对象引用,则初始化为 null. 15 | 16 | 静态初始化只有在必要时才会进行,且只被初始化一次,即如果不创建相应的对象或是引用相应的静态对象,那么则不会被初始化。 17 | 18 | 对象创建过程: 19 | 20 | 1. 构造器实际上也是静态方法。Java 解释器首先查找类路径定位相应 class 文件。 21 | 2. 载入 class 文件,执行静态初始化,静态初始化只在类对象首次加载的适合进行一次。 22 | 3. 使用 new 创建对象时首先将在堆上为对象分配足够的存储空间。 23 | 4. 存储空间清零,故其所有基本类型数据置为默认值。 24 | 5. 执行所有定义处的初始化动作。 25 | 6. 执行构造器。 26 | -------------------------------------------------------------------------------- /hibernate/hibernate_three.md: -------------------------------------------------------------------------------- 1 | # hibernate 的三种状态 2 | 3 | **临时状态(Transient):** 4 | 5 | 当new一个实体对象后, 6 | 这个对象处于临时状态, 7 | 即这个对象只是一个保存临时数据的内存区域, 8 | 如果没有变量引用这个对象, 9 | 则会被jre垃圾回收机制回收. 10 | 这个对象所保存的数据与数据库没有任何关系, 11 | 除非通过Session的save或者SaveOrUpdate把临时对象与数据库关联, 12 | 并把数据插入或者更新到数据库, 13 | 这个对象才转换为持久对象. 14 | 15 | **持久状态(Persistent):** 16 | 17 | 持久化对象的实例在数据库中有对应的记录, 18 | 并拥有一个持久化表示(ID). 19 | 对持久化对象进行delete操作后, 20 | 数据库中对应的记录将被删除, 21 | 那么持久化对象与数据库记录不再存在对应关系, 22 | 持久化对象变成临时状态. 23 | 持久化对象被修改变更后, 24 | 不会马上同步到数据库, 25 | 直到数据库事务提交. 26 | 在同步之前, 27 | 持久化对象是脏的(Dirty). 28 | 29 | **游离状态(Detached):** 30 | 31 | 当Session进行了Close、Clear或者evict后, 32 | 持久化对象虽然拥有持久化标识符和与数据库对应记录一致的值, 33 | 但是因为会话已经消失, 34 | 对象不在持久化管理之内, 35 | 所以处于游离. 36 | 游离状态的对象与临时状态对象是十分相似的, 37 | 只是它还含有持久化标识. 38 | -------------------------------------------------------------------------------- /java/arraylist_vector.md: -------------------------------------------------------------------------------- 1 | # ArrayList 和 Vector 2 | 3 | 这两个类都实现了List接口(List接口继承了Collection接口). 4 | 5 | 他们都是有序集合,即存储在这两个集合中的元素的位置都是有顺序的,相当于一种动态的数组 6 | 7 | 并且其中的数据是允许重复的 8 | 9 | ArrayList与Vector的区别 10 | 11 | * Vector是线程安全的, 12 | 也就是线程同步的, 13 | 而ArrayList是线程序不安全的. 14 | 对于Vector&ArrayList, 15 | Hashtable&HashMap, 16 | 要记住线程安全的问题, 17 | 记住Vector与Hashtable是旧的, 18 | 是java一诞生就提供了的, 19 | 它们是线程安全的, 20 | ArrayList与HashMap是java2时才提供的, 21 | 它们是线程不安全的. 22 | 23 | 24 | * ArrayList与Vector都有一个初始的容量大小, 25 | 当存储进它们里面的元素的个数超过了容量时, 26 | 就需要增加ArrayList与Vector的存储空间, 27 | Vector默认增长为原来两倍,而ArrayList的增长策略在文档中没有明确规定(从源代码看到的是增长为原来的1.5倍).ArrayList与Vector都可以设置初始的空间大小, 28 | Vector还可以设置增长的空间大小, 29 | 而ArrayList没有提供设置增长空间的方法. 30 | 31 | **总结:即Vector增长原来的一倍,ArrayList增加原来的0.5倍. Vector 线程安全, ArrayList 不是.** 32 | 33 | -------------------------------------------------------------------------------- /java/what_is_the_difference_between_a_jdk_and_a_jvm.md: -------------------------------------------------------------------------------- 1 | # JDK JRE JVM? 2 | 3 | * 解释它们的区别 4 | * 为什么 JVM 不是平台独立的 5 | 6 | **JDK** 7 | 8 | Java Development Kit 用作开发, 包含了JRE, 编译器和其他的工具(比如: JavaDoc,Java调试器), 可以让开发者开发、编译、执行Java应用程序. 9 | 10 | **JRE** 11 | 12 | Java 运行时环境是将要执行 Java 程序的 Java 虚拟机, 可以想象成它是一个容器, JVM 是它的内容. 13 | 14 | JRE = JVM + Java Packages Classes(like util, math, lang, awt,swing etc)+runtime libraries. 15 | 16 | **JVM** 17 | 18 | Java virtual machine (Java 虚拟机) 是一个可以执行 Java 编译产生的 Java class 文件 (bytecode) 的虚拟机进程, 是一个纯的运行环境. 19 | 20 | **JVM 不是平台独立的** 21 | 22 | Java被设计成允许应用程序可以运行在任意的平台, 而不需要程序员为每一个平台单独重写或者是重新编译. Java虚拟机让这个变为可能, 因为它知道底层硬件平台的指令长度和其他特性. 23 | 24 | ## Reference 25 | 26 | [Diff between JRE and JVM](http://stackoverflow.com/questions/2812549/what-is-the-difference-between-the-jre-and-jvm) 27 | -------------------------------------------------------------------------------- /hibernate/get_and_load.md: -------------------------------------------------------------------------------- 1 | # get and load 2 | 3 | get vs load is one of the most frequently asked Hibernate Interview question, since correct understanding of both get() and load() is require to effectively using Hibernate. Main difference between get and load is that, get will hit the database if object is not found in the cache and returned completely initialized object, which may involve several database call while load() method can return proxy, if object is not found in cache and only hit database if any method other than getId() is called. This can save lot of performance in some cases. You can also see difference between get and load in Hibernate for more differences and detailed discussion on this question. 4 | 5 | Read more: http://javarevisited.blogspot.com/2013/05/10-hibernate-interview-questions-answers-java-j2ee-senior.html#ixzz3BJkBQ5vg 6 | -------------------------------------------------------------------------------- /j2ee/jsp__include_page_=___and____include_file_=.md: -------------------------------------------------------------------------------- 1 | # 两者的区别 2 | Both the tags include information from one JSP page in another. The differences are: 3 | 4 | < jsp : include page = ... > 5 | 6 | This is like a function call from one jsp to another jsp. It is executed each time the client page is accessed by the client. This approach is useful while modularizing a web application. If the included file changes then the new content will be included in the output automatically. 7 | 8 | <% @ include file = ... > 9 | 10 | In this case the content of the included file is textually embedded in the page that have < % @ include file=".."> directive. In this case when the included file changes, the changed content will not get included automatically in the output. This approach is used when the code from one jsp file required to include in multiple jsp files. 11 | -------------------------------------------------------------------------------- /continuous_integration/README.md: -------------------------------------------------------------------------------- 1 | # Continuous integration 2 | 3 | un ensemble de pratiques utilisées en génie logiciel consistent à vérifier à chaque modification de code source que le résultat des modifications ne produit pas de régression dans l'application développée. 4 | 5 | Pour appliquer cette technique, il faut d'abord que : 6 | 7 | le code source soit partagé 8 | les développeurs commit quotidiennement 9 | des tests d'intégration soient développés pour valider l'application 10 | il faut un outil d'intégration continue 11 | 12 | 好处: 13 | le test immédiat des unités modifiées 14 | la prévention rapide en cas de code incompatible ou manquant 15 | les problèmes d'intégration sont détectés et réparés de façon continue, évitant les problèmes de dernière minute 16 | une version est toujours disponible pour un test, une démonstration ou une distribution 17 | -------------------------------------------------------------------------------- /java/abstract_question.md: -------------------------------------------------------------------------------- 1 | # abstract 相关问题 2 | 3 | **题目一** 4 | 5 | 什么是抽象类 6 | 7 | 1. A class with no methods 8 | 2. A class with no concrete subclasses 9 | 3. A class with at least one undefiend message 10 | 4. None of above 11 | 12 | 答案是 4 我们是可以定义一个抽象空类的 13 | 14 | abstract class emptyAb {} 15 | 16 | **题目二** 17 | 18 | abstract class Base{ 19 | abstract public void myfunc(); 20 | } 21 | 22 | public class Abs extends Base{ 23 | public static void main(String argv[]){ 24 | Abs a = new Abs(); 25 | a.amethod(); 26 | } 27 | 28 | public void amethod(){ 29 | System.out.println("A method"); 30 | } 31 | } 32 | 33 | 运行的结果 34 | 35 | 1. 输出 A method 36 | 2. The code will compile but complain at run time 37 | 3. The compiler will complain errors in Abs class 38 | 39 | 答案是 3 40 | -------------------------------------------------------------------------------- /java/try_catch_finally.md: -------------------------------------------------------------------------------- 1 | # try catch finally 的执行顺序 2 | 3 | 特殊情况就是里面加 return 4 | 5 | 举个例子去理解 6 | 7 | public int getNumber() { 8 | 9 | int a = 0; 10 | 11 | try { 12 | String s = "t"; ------------------------(1) 13 | a = Integer.parseInt(s);-----------(2) 14 | return a; 15 | } catch (NumberFormatException e) { 16 | a = 1;-----------------------------------(3) 17 | return a;-------------------------------(4) 18 | } finally { 19 | a = 2;-----------------------------------(5) 20 | } 21 | } 22 | 23 | 1、程序中标记的代码的执行顺序? 24 | 2、改程序的最后返回值(外部调用时)? 25 | 26 | 程序按顺序从上到下执行到(2),字符"t"转换成整数失败,产生异常并被捕获, 27 | 于是对a赋值成1,并将此值作为此方法的返回值(可以这么认为,该方法有一个存放返回值的空间,此时将1放在此处)。由于存在finally块,在返回前将该方法的内部变量a修改成2。 28 | 所以程序将按标记的顺序执行,外部调用该方法时得到的结果是1 29 | 30 | 先执行try或catch里里面的代码,然后再执行finally,再执行try或catch里面的return. 31 | 32 | -------------------------------------------------------------------------------- /spring/bean_lifecycle.md: -------------------------------------------------------------------------------- 1 | # Bean lifecycle 2 | 3 | 1. Instantiate - 容器在 XML 文件里找到定义并实例化它们 4 | 5 | 2. Populate properties - 使用 DI 填充属性 6 | 7 | 3. Set Bean Name - If the bean implements BeanNameAware interface, spring passes the bean's id to setBeanName() method. 8 | 9 | 4. Set Bean factory - If Bean implements BeanFactoryAware interface, spring passes the beanfactory to setBeanFactory() method. 10 | 11 | 5. Pre Initialization - 也叫 postprocess. Spring 调用 postProcesserBeforeInitialization() 方法. 12 | 13 | 6. Initialize beans - If the bean implements IntializingBean,its afterPropertySet() method is called. If the bean has init method declaration, the specified initialization method is called. 14 | 15 | 7. Post Initialization - 调用 postProcessAfterInitialization() 方法 16 | 17 | 8. Ready to use - 现在可以用它们了. 18 | 19 | 9. Destroy - If the bean implements DisposableBean , it will call the destroy() method . 20 | -------------------------------------------------------------------------------- /java/==_equal.md: -------------------------------------------------------------------------------- 1 | # == 和 equal 的区别 2 | 3 | * **== 比较引用的地址** 4 | * **equel 比较引用的内容** (Object 类本身除外) 5 | 6 | 7 | String obj1 = new String("xyz"); 8 | String obj2 = new String("xyz"); 9 | 10 | // If String obj2 = obj1, the output will be true 11 | 12 | if(obj1 == obj2) 13 | System.out.printlln("obj1==obj2 is TRUE"); 14 | else 15 | System.out.println("obj1==obj2 is FALSE"); 16 | 17 | // It will print obj1==obj2 is False 18 | // If String obj2 = obj1, the output will be true 19 | 20 | 默认的, equals() 方法实际上和 “==” 在 object 类里是一样的. 但是这个方法在每一个子类里都会被覆写用来比较引用的内容 (因为每个类都继承了 object 类并覆写了这个方法) 21 | 22 | String obj1 = new String("xyz"); 23 | String obj2 = new String("xyz"); 24 | 25 | if(obj1.equals(obj2)) 26 | System.out.printlln("obj1==obj2 is TRUE"); 27 | else 28 | System.out.println("obj1==obj2 is FALSE"); 29 | 30 | Resultat: obj1==obj2 is TRUE 31 | -------------------------------------------------------------------------------- /java/java_data_types.md: -------------------------------------------------------------------------------- 1 | # Java Data Types - Java 数据类型 2 | 3 | JVM 可以操作的数据类型分为两类: primitive types 和 reference types. 类型检查通常在编译期完成,不同指令操作数的类型可以通过虚拟机的字节码指令本身确定。 4 | 5 | ## Primitive type 6 | 7 | JVM 所支持的基本数据类型有:数值类型(Numeric types), 布尔类型(Boolean type) 和 returnAddress 类型。其中数值类型又可以分为整型和浮点型两种。 8 | 9 | - 整型:byte(8 bit), short(16 bit), int(32 bit), long(64 bit), char(16 bit unsigned) 10 | - 浮点型:float(32 bit), double(64 bit) 11 | - 布尔型:boolean 通常用 int 型表示,Oracle 中用 byte 表示 12 | - returnAddress:一条字节码指令的操作码 13 | 14 | ## Reference type 15 | 16 | 引用类型分为三种:Class Types, Array Types 和 Interface Types, 这些引用类型的值分别由类实例、数组实例和实现了某个接口的类实例或者数组实例动态创建。引用类型中有一特殊的值`null`, 引用类型的默认值就是 null. 17 | 18 | ## 形式参数传递 19 | 20 | 基本类型作为形式参数传递不会改变实际参数,引用类型作为形式参数传递会改变实际参数。JDK1.5之后含有基本类型的包装类型,即自动拆装箱的功能,故将基本类型的相应对象作为参数传递时会自动拆箱为基本类型,故也不改变实际参数的值。 21 | 22 | ## Reference 23 | 24 | - [Chapter 2. The Structure of the Java Virtual Machine](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html) 25 | -------------------------------------------------------------------------------- /java/article_differe.md: -------------------------------------------------------------------------------- 1 | # 静态变量和实例变量的区别? 2 | 3 | * 在语法定义上的区别:静态变量前要加static关键字,而实例变量前则不加。 4 | 5 | * 在程序运行时的区别:实例变量属于某个对象的属性, 6 | 必须创建了实例对象(比如 new 一个), 7 | 其中的实例变量才会被分配空间, 8 | 才能使用这个实例变量. 9 | 静态变量不属于某个实例对象, 10 | 而是属于类, 11 | 所以也称为类变量, 12 | 只要程序加载了类的字节码, 13 | 不用创建任何实例对象, 14 | 静态变量就会被分配空间, 15 | 静态变量就可以被使用了. 16 | 17 | * 总之,实例变量必须创建对象后才可以通过这个对象来使用,静态变量则可以直接使用类名来引用. 18 | 19 | 例如, 20 | 对于下面的程序, 21 | 无论创建多少个实例对象, 22 | 永远都只分配了一个staticVar变量, 23 | 并且每创建一个实例对象, 24 | 这个staticVar就会加; 25 | 但是, 26 | 每创建一个实例对象, 27 | 就会分配一个instanceVar, 28 | 即可能分配多个instanceVar, 29 | 并且每个instanceVar的值都只自加了1次. 30 | 31 | 32 | public class VariantTest{ 33 | 34 | public static int staticVar = 0; 35 | public int instanceVar = 0; 36 | 37 | public VariantTest(){ 38 | staticVar++; 39 | instanceVar++; 40 | System.out.println(“staticVar=” + staticVar + ”,instanceVar=”+ instanceVar); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /scrum/how_to_scrum.md: -------------------------------------------------------------------------------- 1 | # How to scrum 2 | 3 | 1、我们首先需要确定一个Product Backlog, 这个是由Product Owner 负责的 4 | 5 | 2、Scrum Team根据Product Backlog列表, 6 | 做工作量的预估和安排 7 | 8 | 3、有了Product Backlog列表, 9 | 我们需要通过 Sprint Planning Meeting 来从中挑选出一个Story作为本次迭代完成的目标, 然后把这个Story进行细化, 10 | 形成一个Sprint Backlog; 11 | 12 | 4、每个成员根据Sprint Backlog再细化成更小的任务(细到每个任务的工作量在2天内能完成) 13 | 14 | 5、要进行 Daily Scrum Meeting(每日站立会议),每次会议控制在15分钟左右,每个人都必须发言,并且要向所有成员当面汇报你昨天完成了什么,并且向所有成员承诺你今天要完成什么,同时遇到不能解决的问题也可以提出,每个人回答完成后,要走到黑板前更新自己的 Sprint burn down(Sprint燃尽图); 15 | 16 | 6、做到每日集成,也就是每天都要有一个可以成功编译、并且可以演示的版本;很多人可能还没有用过自动化的每日集成,其实TFS就有这个功能,它可以支持每次有成员进行签入操作的时候,在服务器上自动获取最新版本,然后在服务器中编译,如果通过则马上再执行单元测试代码,如果也全部通过,则将该版本发布,这时一次正式的签入操作才保存到TFS中,中间有任何失败,都会用邮件通知项目管理人员; 17 | 18 | 7、当一个Story完成,也就是Sprint Backlog被完成,也就表示一次Sprint完成,这时,我们要进行 Srpint Review Meeting(演示会议),也称为评审会议,产品负责人和客户都要参加(最好本公司老板也参加),每一个Scrum Team的成员都要向他们演示自己完成的软件产品 19 | 20 | 8、最后就是 Sprint Retrospective Meeting(回顾会议),也称为总结会议,以轮流发言方式进行,每个人都要发言,总结并讨论改进的地方,放入下一轮Sprint的产品需求中; 21 | -------------------------------------------------------------------------------- /java/the_difference_between_static_variables_and_instance_variables.md: -------------------------------------------------------------------------------- 1 | # 静态变量和实例变量的区别? 2 | 3 | * 在语法定义上的区别:静态变量前要加static关键字,而实例变量前则不加。 4 | 5 | * 在程序运行时的区别:实例变量属于某个对象的属性, 6 | 必须创建了实例对象(比如 new 一个), 7 | 其中的实例变量才会被分配空间, 8 | 才能使用这个实例变量. 9 | 静态变量不属于某个实例对象, 10 | 而是属于类, 11 | 所以也称为类变量, 12 | 只要程序加载了类的字节码, 13 | 不用创建任何实例对象, 14 | 静态变量就会被分配空间, 15 | 静态变量就可以被使用了. 16 | 17 | * 总之,实例变量必须创建对象后才可以通过这个对象来使用,静态变量则可以直接使用类名来引用. 18 | 19 | 例如, 20 | 对于下面的程序, 21 | 无论创建多少个实例对象, 22 | 永远都只分配了一个staticVar变量, 23 | 并且每创建一个实例对象, 24 | 这个staticVar就会加; 25 | 但是, 26 | 每创建一个实例对象, 27 | 就会分配一个instanceVar, 28 | 即可能分配多个instanceVar, 29 | 并且每个instanceVar的值都只自加了1次. 30 | 31 | 32 | public class VariantTest{ 33 | 34 | public static int staticVar = 0; 35 | public int instanceVar = 0; 36 | 37 | public VariantTest(){ 38 | staticVar++; 39 | instanceVar++; 40 | System.out.println(“staticVar=” + staticVar + ”,instanceVar=”+ instanceVar); 41 | } 42 | } 43 | 44 | 45 | -------------------------------------------------------------------------------- /java/if_i_write_return_at_the_end_of_the_try_block,_will_the_finally_block_still_execute.md: -------------------------------------------------------------------------------- 1 | # 如果在 try 模块里最后加了个 return, finally 模块还会执行吗? 2 | 3 | 是的. finally 模块会先执行再 return. 4 | 5 | # 如果换成 System.exit (0)? 6 | 7 | 那就不会了. System.exit (0) 时. 会立马跳出程序. 8 | 9 | # try catch finally 的执行顺序 10 | 11 | 特殊情况就是里面加 return 12 | 13 | 举个例子去理解 14 | 15 | public int getNumber() { 16 | 17 | int a = 0; 18 | 19 | try { 20 | String s = "t"; ------------------------(1) 21 | a = Integer.parseInt(s);-----------(2) 22 | return a; 23 | } catch (NumberFormatException e) { 24 | a = 1;-----------------------------------(3) 25 | return a;-------------------------------(4) 26 | } finally { 27 | a = 2;-----------------------------------(5) 28 | } 29 | } 30 | 31 | 1、程序中标记的代码的执行顺序? 32 | 2、改程序的最后返回值(外部调用时)? 33 | 34 | 程序按顺序从上到下执行到(2),字符"t"转换成整数失败,产生异常并被捕获, 35 | 于是对a赋值成1,并将此值作为此方法的返回值(可以这么认为,该方法有一个存放返回值的空间,此时将1放在此处)。由于存在finally块,在返回前将该方法的内部变量a修改成2。 36 | 所以程序将按标记的顺序执行,外部调用该方法时得到的结果是1 37 | 38 | 先执行try或catch里里面的代码,然后再执行finally,再执行try或catch里面的return. 39 | 40 | -------------------------------------------------------------------------------- /spring/what_are_benefits_of_using_spring.md: -------------------------------------------------------------------------------- 1 | # what are benefits of using spring? 2 | 3 | Lightweight: Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 2MB. 4 | 5 | Inversion of control (IOC): Loose coupling is achieved in spring using the technique Inversion of Control. The objects give their dependencies instead of creating or looking for dependent objects. 6 | 7 | Aspect oriented (AOP): Spring supports Aspect oriented programming and enables cohesive development by separating application business logic from system services. 8 | 9 | Container: Spring contains and manages the life cycle and configuration of application objects. 10 | 11 | MVC Framework 12 | 13 | Transaction Management: Spring provides a consistent transaction management interface that can scale down to a local transaction (using a single database, for example) and scale up to global transactions (using JTA, for example). 14 | 15 | Exception Handling: Spring provides a convenient API to translate technology-specific exceptions (thrown by JDBC, Hibernate, or JDO, for example) into consistent, unchecked exceptions. 16 | -------------------------------------------------------------------------------- /java/collection_questions.md: -------------------------------------------------------------------------------- 1 | # Collection 相关问题 2 | 3 | **题目一** 4 | 5 | You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be access in nature order, which interface provies that capabiliy? 6 | 7 | A. java.util.Map 8 | B. java.util.Collection 9 | C. java.util.List 10 | D. java.util.Set 11 | 12 | 答案 D 13 | 14 | **题目二** 15 | 16 | List, Set, Map是否继承自Collection接口,它们有什么区别? 17 | 18 | List,Set是,Map不是 19 | 20 | Set 不允许有重复的元素.且没有顺路 Set取元素时,没法说取第几个,只能以Iterator接口取得所有的元素,再逐一遍历各个元素. 21 | 22 | List表示有先后顺序的集合并且允许重复 23 | 24 | Map与List和Set不同,存储一对key/value,不能存储重复的key 25 | 26 | **题目三** 27 | 28 | ``` 29 | public static void main(){ 30 | Map map = new HashMap(); 31 | map.out(String.valueOf(System.currentTimeMillis())+"a",1); 32 | map.out(String.valueOf(System.currentTimeMillis())+"a",2); 33 | map.out(String.valueOf(System.currentTimeMillis())+"a",3); 34 | for(Map.Entry entry : map.entrySet()){ 35 | System.out.printf(entry.getValue()); 36 | } 37 | }``` 38 | 39 | 输出顺序是 123顺序无法确定. Map 中的键是 Set. Set 顺序是随机的. 40 | -------------------------------------------------------------------------------- /j2ee/jsp_lifecycle.md: -------------------------------------------------------------------------------- 1 | 2 | # JSP 的生命周期? 3 | 4 | 1. Compilation 5 | 2. Initialization 6 | 3. Execution 7 | 4. Cleanup 8 | 9 | 详细解释 10 | 11 | Compilation: When a browser asks for a JSP, the JSP engine first checks to see whether it needs to compile the page. If the page has never been compiled, or if the JSP has been modified since it was last compiled, the JSP engine compiles the page. 12 | 13 | 编译的三个步骤: 14 | 15 | 1. Parsing the JSP. 16 | 2. Turning the JSP into a servlet. 17 | 3. **Compiling the servlet.** 18 | 19 | Initialization: When a container loads a JSP it invokes the jspInit() method before servicing any requests 20 | 21 | Execution: Whenever a browser requests a JSP and the page has been loaded and initialized, the JSP engine invokes the _jspService() method in the JSP.The _jspService() method of a JSP is invoked once per a request and is responsible for generating the response for that request and this method is also responsible for generating responses to all seven of the HTTP methods ie. GET, POST, DELETE etc. 22 | 23 | Cleanup: The destruction phase of the JSP life cycle represents when a JSP is being removed from use by a container.The jspDestroy() method is the JSP equivalent of the destroy method for servlets. 24 | -------------------------------------------------------------------------------- /java/polymorphism.md: -------------------------------------------------------------------------------- 1 | # 多态 Polymorphism 2 | 3 | 多态就是指一个变量, 一个方法或者一个对象可以有不同的形式. 4 | 5 | 多态主要分为 6 | 7 | * 重载overloading 8 | 9 | 10 | 就是一个类里有两个或更多的函数,名字相同而他们的参数不同. 11 | 12 | * 覆写overriding 13 | 14 | 15 | 是发生在子类中!也就是说必须有继承的情况下才有覆盖发生. 当你继承父类的方法时, 如果你感到哪个方法不爽,功能要变,那就把那个函数在子类中重新实现一遍. 16 | 17 | **例子** 18 | 19 | 重载 静态捆绑 (static binding) 是 Compile 时的多态 20 | 21 | EmployeeFactory.create(String firstName, String lastName){...} 22 | EmployeeFactory.create(Integer id, String lastName){...} 23 | 24 | 覆写 动态捆绑 (dynamic binding) 是 runtime 多态 25 | 26 | public class Animal { 27 | public void makeNoise() 28 | { 29 | System.out.println("Some sound"); 30 | } 31 | } 32 | 33 | class Dog extends Animal{ 34 | public void makeNoise() 35 | { 36 | System.out.println("Bark"); 37 | } 38 | } 39 | 40 | class Cat extends Animal{ 41 | public void makeNoise() 42 | { 43 | System.out.println("Meawoo"); 44 | } 45 | } 46 | 47 | 48 | public class Demo 49 | { 50 | public static void main(String[] args) { 51 | Animal a1 = new Cat(); 52 | a1.makeNoise(); //Prints Meowoo 53 | 54 | Animal a2 = new Dog(); 55 | a2.makeNoise(); //Prints Bark 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /java/hashcode__equal.md: -------------------------------------------------------------------------------- 1 | # equals() 与 hashcode() 2 | 3 | ### **Equal ** 4 | 5 | 如果需要比较对象的值,就需要equal方法了. 6 | 看一下JDK中equal方法的实现: 7 | 8 | public boolean equals(Object obj) { 9 | return (this == obj); 10 | } 11 | 12 | 也就是说,默认情况下比较的还是对象的地址. 所以如果把对象放入Set中等操作,就需要重写eqaul方法了 13 | 14 | 重写之后的 equals() 比较的就是对象的内容了 15 | 16 | 17 | ### **hashcode ** 18 | 19 | When inserting an object into a hastable you use a key. The hash code of this key is calculated, and used to determine where to store the object internally. When you need to lookup an object in a hashtable you also use a key. The hash code of this key is calculated and used to determine where to search for the object. 20 | 21 | The hash code only points to a certain "area" (or list, bucket etc) internally. Since different key objects could potentially have the same hash code, the hash code itself is no guarantee that the right key is found. The hashtable then iterates this area (all keys with the same hash code) and uses the key's equals() method to find the right key. Once the right key is found, the object stored for that key is returned. 22 | 23 | So, as you can see, a combination of the hashCode() and equals() methods are used when storing and when looking up objects in a hashtable. 24 | 25 | **If equal, then same hash codes too.** 26 | **Same hash codes no guarantee of being equal.** 27 | -------------------------------------------------------------------------------- /java/integer_==.md: -------------------------------------------------------------------------------- 1 | # integer 通过 == 比较 2 | 3 | Integer a=10; 4 | Integer b=10; 5 | Integer c=new Integer(10); 6 | Integer d=new Integer(10); 7 | 8 | System.out.println(a==b); 9 | System.out.println(c==d); 10 | 11 | System.out.println(a.equals(b)); 12 | System.out.println(c.equals(d)); 13 | 14 | System.out.println(a.equals(c)); 15 | 16 | 17 | 结果为 18 | 19 | true 20 | false 21 | true 22 | true 23 | true 24 | 25 | == 比较的是对象的引用 26 | 当且仅当比较的两个引用指向同一对象才返回true 27 | 28 | 再看一个例子 29 | 30 | Integer a = 127; 31 | Integer b = 127; 32 | Integer c = 128; 33 | Integer d = 128; 34 | System.out.println(a == b); 35 | System.out.println(c == d); 36 | 37 | 38 | 结果为 39 | 40 | true 41 | false 42 | 43 | 44 | Integer i = XXX 45 | 看看Integer 的源代码就知道了, 46 | 其实就是Integer 把-128-127(一个字节的二进制补码) 之间的每个值都建立了一个对应的Integer 对象, 47 | 类似一个缓存. 48 | 由于Integer 是不可变类, 49 | 因此这些缓存的Integer 对象可以安全的重复使用. 50 | Integer i = XXX, 51 | 就是Integer i = Interger.valueOf(XXX), 52 | 首先判断XXX 是否在-128-127 之间, 53 | 如果是直接return 已经存在的对象, 54 | 所以是同一个引用. 55 | 否则就只能 new 一个了, 56 | 那就是不同的引用了. 57 | 58 | ## Reference 59 | 60 | - [java - Why does 128==128 return false but 127==127 return true in this code? - Stack Overflow](http://stackoverflow.com/questions/1700081/why-does-128-128-return-false-but-127-127-return-true-in-this-code) 61 | -------------------------------------------------------------------------------- /java/run-time_data_areas.md: -------------------------------------------------------------------------------- 1 | # Run-Time Data Areas - 运行时数据区域 2 | 3 | JVM 运行时会有几个运行时数据区域,如下图所示。 4 | 5 | ![Run Time Data Areas](../images/java_run_time_data_areas.jpeg) 6 | 7 | ## The pc Register - 程序计数器 8 | 9 | 线程私有内存,保存**当前线程所执行的字节码的行号指示器**,这里和计算机组成原理中的计数器不太一样,计组中的 PC 指的是**下一条要执行的指令**的地址。JVM 中常有多个线程执行,故每条线程都需要有一个独立的程序计数器。 10 | 11 | 如果线程执行的是 Java 方法,哪儿计数器记录的就是正在执行的虚拟机字节码指令的地址;如果执行的是 Native 方法,这个计数器则为空。 12 | 13 | P.S. 这块内存无`OutOfMemoryError` 14 | 15 | ## Java Virtual Machine Stacks - Java 虚拟机栈 16 | 17 | 线程私有,虚拟机栈描述的是 Java 方法执行的内存模型,每个方法在执行时会创建一个栈帧,栈帧中保存有局部变量表、操作数栈、动态链接和方法出口等。粗略来讲 Java 内存区分为堆和栈,实际上『栈』指的往往是虚拟机栈中的局部变量表部分。 18 | 19 | 局部变量表中存放了编译期可知的各种基本数据类型、对象引用类型和 returnAddress 类型。方法运行期间局部变量表大小不变。 20 | 21 | ## Native Method Stacks - 本地方法栈 22 | 23 | 和虚拟机栈类似,不过区别在于虚拟机栈为 Java 方法(字节码)服务,而本地方法栈为 Native 方法服务(类似 C 语言中的栈)。具体实现可将这两者合二为一。 24 | 25 | ## Heap - 堆 26 | 27 | 堆是被所有线程共享的一块内存区域。一般来说所有的对象实例和数组都要在堆上分配,但一些优化技术导致不一定所有对象实例都在堆上分配。 28 | 29 | ## Method Area - 方法区 30 | 31 | 各线程共享的一块内存区域,和操作系统中进程中的『文本段』有些类似,用于存储虚拟机加载的类信息、常量、静态常量和即时编译器编译后的代码数据等。 32 | 33 | ## Run-Time Constant Pool - 运行时常量池 34 | 35 | 这一部分是方法区的一部分,用于保存 Class 文件中编译期生成的字面值和符号引用。 36 | 37 | ## 直接内存 38 | 39 | 这一部分并不是虚拟机运行时的数据区域,用于 Native 函数分配堆外内存,提高性能用(不必在操作系统堆和 Java 堆复制数据)。 40 | 41 | ## Reference 42 | 43 | - 《深入理解 Java 虚拟机》 44 | - [Java 内存区域详解 - SegmentFault](http://segmentfault.com/a/1190000002931555) 45 | - [Chapter 2. The Structure of the Java Virtual Machine](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html) 46 | -------------------------------------------------------------------------------- /java/super_gai_nian.md: -------------------------------------------------------------------------------- 1 | # super 关键词 2 | 3 | * 调用父类 (Superclass) 的成员或者方法 4 | * 调用父类的构造函数 5 | 6 | 7 | 1. 调用父类 (Superclass) 的成员或者方法 8 | 9 | 如果你的方法覆写一个父类成员的方法, 你可以通过 super 关键字调用父类的方法. 考虑下面的父类: 10 | 11 | public class Superclass { 12 | 13 | public void printMethod() { 14 | System.out.println("Printed in Superclass."); 15 | } 16 | } 17 | 18 | 下面是一个子类 (subclass), 叫做 Subclass, 覆写了 printMethod(): 19 | 20 | public class Subclass extends Superclass { 21 | 22 | // overrides printMethod in Superclass 23 | public void printMethod() { 24 | super.printMethod(); 25 | System.out.println("Printed in Subclass"); 26 | } 27 | public static void main(String[] args) { 28 | Subclass s = new Subclass(); 29 | s.printMethod(); 30 | } 31 | } 32 | 33 | 输出 34 | 35 | Printed in Superclass. 36 | Printed in Subclass 37 | 38 | 39 | 2. 调用父类的构造函数 40 | 41 | 使用 **super** 关键字调用父类的构造函数. 下面的 MountainBike 类是 Bicycle 类的子类. 它调用了父类的构造方法并加入了自己的初始化代码: 42 | 43 | public MountainBike(int startHeight, 44 | int startCadence, 45 | int startSpeed, 46 | int startGear) { 47 | super(startCadence, startSpeed, startGear); 48 | seatHeight = startHeight; 49 | } 50 | 51 | 调用父类的构造体必须放在**第一行**. 52 | 53 | 使用 54 | 55 | super(); 56 | 57 | 或者: 58 | 59 | super(parameter list); 60 | 61 | 通过 super(), 父类的无参构造体会被调用. 通过 super(parameter list), 父类对应参数的构造体会被调用. 62 | 63 | 注意: 构造体如果没有显式的调用父类的构造体, Java 编译器自动调用父类的无参构造. 如果父类没有无参构造, 就会报错 ( compile-time error). 64 | -------------------------------------------------------------------------------- /java/exception_question1.md: -------------------------------------------------------------------------------- 1 | # 异常选择题 2 | 3 | **题目一** 4 | 5 | 下面哪个不对 6 | 7 | 1. RuntimeException is the superclass of those exceptions that must be thrown during the normal operation of the JVM 8 | 9 | 2. A method is not required to declare in its throws clause any subclasses of RuntimeExeption that might be thrown during the execution of the method but not caught. 10 | 11 | 3. An RuntimeException is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. 12 | 13 | 4. NullPointerException is one kind of RuntimeException 14 | 15 | 答案是 3 16 | 17 | RuntimeException an unchecked exception. It doesn't need to be explicitly declared or catched. 18 | 19 | **题目二** 20 | 21 | 特殊情况就是里面加 return 22 | 23 | 举个例子去理解 24 | 25 | public int getNumber() { 26 | 27 | int a = 0; 28 | 29 | try { 30 | String s = "t"; ------------------------(1) 31 | a = Integer.parseInt(s);-----------(2) 32 | return a; 33 | } catch (NumberFormatException e) { 34 | a = 1;-----------------------------------(3) 35 | return a;-------------------------------(4) 36 | } finally { 37 | a = 2;-----------------------------------(5) 38 | } 39 | } 40 | 41 | 1、程序中标记的代码的执行顺序? 42 | 2、改程序的最后返回值(外部调用时)? 43 | 44 | 程序按顺序从上到下执行到(2), 45 | 字符"t"转换成整数失败, 46 | 产生异常并被捕获, 47 | 于是对a赋值成1, 48 | 并将此值作为此方法的返回值(可以这么认为, 49 | 该方法有一个存放返回值的空间, 50 | 此时将1放在此处). 51 | 由于存在finally块, 52 | 在返回前将该方法的内部变量a修改成2. 53 | 所以程序将按标记的顺序执行, 54 | 外部调用该方法时得到的结果是1 55 | 56 | 先执行try或catch里里面的代码,然后再执行finally,再执行try或catch里面的return. 57 | 58 | **题目三** 59 | 60 | 写出你最常见到的5个runtime exception 61 | 62 | ClassCastException 63 | IllegalArgumentException 64 | NullPointerException 65 | IndexOutOfBoundsException 66 | ArrayIndexOutOfBoundsException 67 | 68 | **题目四** 69 | -------------------------------------------------------------------------------- /java/this_question.md: -------------------------------------------------------------------------------- 1 | # this 程序题 2 | 3 | **题目一** 4 | 5 | class Tester{ 6 | int var; 7 | Tester(double var){this.var = (int)var}; 8 | Tester(int var){this("hello"); 9 | Tester(String s){ 10 | this(); 11 | System.out.println(s); 12 | } 13 | 14 | Tester(){ System.out.println("good-bye");} 15 | } 16 | 17 | Tester t = new Tester(5) 的输出是什么? 18 | 19 | good-bye 20 | hello 21 | 22 | 23 | **题目二** 24 | 25 | 貌似和 this 无关但是很重要 26 | public class Base { 27 | int i; 28 | 29 | Base(){ 30 | add(1); 31 | System.out.println(i); 32 | } 33 | 34 | void add(int v){ 35 | i+=v; 36 | System.out.println(i); 37 | } 38 | } 39 | 40 | public class MyBase extends Base{ 41 | MyBase(){ 42 | System.out.println("MyBase"); 43 | add(2); 44 | } 45 | 46 | void add(int v){ 47 | System.out.println("MyBase Add"); 48 | i+=v*2; 49 | System.out.println(i); 50 | } 51 | } 52 | 53 | public class Test { 54 | public static void main(String[] args) { 55 | go(new MyBase()); 56 | } 57 | 58 | static void go(Base b){ 59 | b.add(8); 60 | } 61 | } 62 | 63 | 输出的结果是 22 64 | 65 | 子类会首先调用父类的构造函数,在父类的构造函数 Base() 中执行 add() 方法. 但这个 add() 方法由于是在新建 MyBase 对象时调用的. 所以是执行的 MyBase 中的 add 方法 66 | 67 | 在Java中,子类的构造过程中,必须 调用其父类的构造函数, 68 | 是因为有继承关系存在时, 69 | 子类要把父类的内容继承下来, 70 | 通过什么手段做到的? 71 | 这样: 72 | 当你new一个子类对象的时候, 73 | 必须首先要new一个父类的对像出来, 74 | 这个父类对象位于子类对象的内部, 75 | 所以说,子类对象比父类对象大, 76 | 子类对象里面包含了一个父类的对象, 77 | 这是内存中真实的情况. 78 | 79 | 构造方法是new一个对象的时候, 80 | 必须要调的方法, 81 | 这是规定, 82 | 要new父类对象出来, 83 | 那么肯定要调用其构造方法, 84 | 所以 85 | **第一个规则:子类的构造过程中,必须 调用其父类的构造方法** 86 | 87 | 一个类, 88 | 如果我们不写构造方法, 89 | 那么编译器会帮我们加上一个默认的构造方法, 90 | 所谓默认的构造方法, 91 | 就是没有参数的构造方法, 92 | 但是如果你自己写了构造方法, 93 | 那么编译器就不会给你添加了 94 | 95 | 所以有时候当你new一个子类对象的时候,肯定调用了子类的构造方法,但是在子类构造方法中我们并没有显示的调用基类的构造方法,就是没写,如:super(); 并没有这样写,但是 96 | 97 | **第二个规则:如果子类的构造方法中没有显示的调用基类构造方法,则系统默认调用基类无参数的构造方法** 98 | 99 | 注意:如果子类的构造方法中既没有显示的调用基类构造方法,而基类中又没有默认无参的构造方法,则编译出错,所以,通常我们需要显示的:super(参数列表),来调用父类有参数的构造函数 100 | 101 | -------------------------------------------------------------------------------- /java/string_questions.md: -------------------------------------------------------------------------------- 1 | # 字符串基础问题 2 | 3 | **题目一** 4 | ``` 5 | public class Test{ 6 | public static void main(String[] args){ 7 | String s1 = "abc"; 8 | String s2 = s1; 9 | String s3 = new String("abc"); 10 | String s4 = new String("abc"); 11 | String s5 = "abc"; 12 | 13 | System.out.println(s1==s5); 14 | System.out.println(s1==s2); 15 | System.out.println(s1.equals(s2)); 16 | System.out.println(s3==s4); 17 | System.out.println(s1.equals(s4)); 18 | System.out.println(s3.equals(s4)); 19 | } 20 | }``` 21 | 22 | 输出是 true true true false true true 23 | 24 | 记住 == 比较引用. equals 比较值. String 对象会创建一个字符串池 (a pool of string), 如果当前准备新创建的字符串对象的值在这个池子中已经存在,那么就不会生成新对象, 而是复用池中已有的字符串对象. 不过, 只有采用 Object s = “Hello” 方式 (而非用”new“关键字) 声明 String 对象的时候这个规则才会被应用. 25 | 26 | **题目二** 27 | 28 | String s = "a" + "b" + "c" + "d" + "e" 29 | 30 | 创建了几个对象? 1个 赋值号右边都是常量,编译时直接储存它们的字面值, 在编译时直接把结果取出来面成了 "abcde" 31 | 32 | **题目三** 33 | 34 | ``` 35 | # 创建了几个String Object?二者之间有什么区别? 36 | 37 | String s = new String("xyz");``` 38 | 39 | 两个或一个, 40 | ”xyz”对应一个对象, 41 | 这个对象放在字符串常量缓冲区, 42 | 常量”xyz”不管出现多少遍, 43 | 都是缓冲区中的那一个. 44 | New String每写一遍, 45 | 就创建一个新的对象, 46 | 它一句那个常量”xyz”对象的内容来创建出一个新String对象. 47 | 如果以前就用过’xyz’, 48 | 这句代表就不会创建”xyz”自己了, 49 | 直接从缓冲区拿. 50 | 51 | **题目四** 52 | 53 | String s1 = new String("777"); 54 | String s2 = "aaa777"; 55 | String s3 = "aaa" + "777"; 56 | String s4 = "aaa" + s1; 57 | 58 | s2 == S3 : true 59 | s2 == S4 : false 60 | s2 == S4.intern() : true 61 | 62 | 63 | **题目五** 64 | 65 | String str = "ABCDEFGH"; 66 | String str1 = str.substring(3,5); 67 | System.oout.println(str1); 68 | 69 | 输出是 DE substring 是前包括后不包括 70 | 71 | **题目六** 72 | 73 | 执行后,原始的 String 对象中的内容到底变了没有? 74 | 75 | String s = "Hello"; 76 | s = s + " world!"; 77 | 78 | 没有. 79 | 因为 String 被设计成**不可变(immutable)类**, 80 | 所以它的所有对象都是不可变对象. 81 | 82 | 在这段代码中, 83 | s原先指向一个String对象, 84 | 内容是 "Hello",然后我们对s进行了+操作, 85 | 这时,s不指向原来那个对象了, 86 | 而指向了另一个 String对象, 87 | 内容为"Hello world!", 88 | 原来那个对象还存在于内存之中, 89 | 只是s这个引用变量不再指向它了. 90 | 91 | **题目七** 92 | 93 | 执行后,输出是什么? 共创建了几个字符串对象? 94 | 95 | String s = " Hello "; 96 | s += " World "; 97 | s.trim( ); 98 | System.out.println(s); 99 | 100 | 再次强调 String 是**不可变(immutable)类**. 101 | 所以共创建了三个对象. 最后输出是 " Hello World ". 102 | 只有 s = s.trim() 之后才是 "Hello World". 103 | -------------------------------------------------------------------------------- /java/question_interface_2.md: -------------------------------------------------------------------------------- 1 | # 基础程序题 2 | 3 | **题目一** 4 | 5 | class Base{} 6 | 7 | class Agg extends Base{ 8 | public String getFields(){ 9 | String name = "Agg"; 10 | return name; 11 | } 12 | } 13 | 14 | public class Avf{ 15 | pulic static void main(String argv[]){ 16 | Base a = new Agg(); 17 | //here 18 | } 19 | } 20 | 21 | 下面哪个选项的代码替换到//here会调用getFields方法,使出书结果是Agg 22 | 23 | A. System.out.println(a.getFields()); 24 | B. System.out.println(a.name); 25 | C. System.out.println((Base)a.getFields()); 26 | D. System.out.println(((Agg)a).getFields()); 27 | 28 | 答案 D 29 | 30 | Base 类要引用 Agg 类的实例需要把 Base 类显示地转换成 Agg 类,然后调用 Agg 类中的方法. 如果 a 是 Base 类的一个实例,是不存在这个方法的,必须把 a 转换成 Agg 的一个实例 31 | 32 | **题目二** 33 | 34 | class A{ 35 | 36 | public A(){ 37 | System.out.println("A"); 38 | } 39 | } 40 | 41 | public class B extends A{ 42 | 43 | public B(){ 44 | System.out.println("B"); 45 | } 46 | 47 | public static void main(String[] args){ 48 | A a = new B(); 49 | a = new A(); 50 | } 51 | } 52 | 53 | 输出结果是 A B A 54 | 55 | **题目三** 56 | 57 | class A{ 58 | public void print(){ 59 | System.out.println("A"); 60 | } 61 | } 62 | 63 | class B extends A{ 64 | public void print(){ 65 | System.out.println("B"); 66 | } 67 | } 68 | 69 | public class Test{ 70 | .. 71 | B objectB = new B(); 72 | objectB.print(); 73 | 74 | A as = (A) objectB; 75 | as.print(); 76 | 77 | A asg = objectB; 78 | asg.print(); 79 | 80 | as = new A(); 81 | as.print(); 82 | .. 83 | } 84 | 85 | 输出为 B B B A 86 | 87 | **题目四** 88 | 89 | public class Test { 90 | public static void main(String[] args){ 91 | Father father = new Father(); 92 | Father child = new Child(); 93 | System.out.println(father.getName()); 94 | System.out.println(child.getName()); 95 | } 96 | } 97 | 98 | class Father{ 99 | public static String getName(){ 100 | return "Father"; 101 | } 102 | } 103 | 104 | class Child extends Father{ 105 | public static String getName(){ 106 | return "Child"; 107 | } 108 | } 109 | 110 | 输出是 Father Father 因为这里的方法 getName 是静态的. 具体执行哪一个,则要看是由哪个类来调用的. 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /java/super_question_1.md: -------------------------------------------------------------------------------- 1 | # Super 程序题 2 | 3 | **题目一** 4 | 5 | class Base{ 6 | Base(){ 7 | System.out.println("Base"); 8 | } 9 | } 10 | 11 | public class Checket extends Base{ 12 | Checket(){ 13 | System.out.println("Checket"); 14 | super(); 15 | } 16 | public static void main(String argv[]){ 17 | Checket a = new Checket(); 18 | } 19 | } 20 | 21 | 输出是什么? 是 compile time error. super() 必须放在前面. 22 | 23 | 放在前面之后,输出为 Base Checket 24 | 25 | **题目二** 26 | 27 | import java.util.Date; 28 | 29 | public class Test extends Date{ 30 | 31 | public static void main(String[] args) { 32 | new Test().test(); 33 | } 34 | 35 | public void test(){ 36 | System.out.println(super.getClass().getName()); 37 | } 38 | } 39 | 40 | 返回的结果是 Test 41 | 42 | 因为super.getClass().getName() 调用了父类的 getClass() 方法, 返回当前类 43 | 44 | 如果想得到父类的名称,应该用如下代码: 45 | 46 | getClass().getSuperClass().getName() 47 | 48 | **题目三** 49 | 50 | public abstract class Car { 51 | 52 | String name = "Car"; 53 | 54 | public String getName(){ 55 | return name; 56 | } 57 | 58 | public abstract void demarre(); 59 | } 60 | 61 | public class B extends Car{ 62 | String name = "B"; 63 | 64 | public String getName(){ 65 | return name; 66 | } 67 | 68 | public void demarre() { 69 | System.out.println(getName() + " demarre"); 70 | } 71 | } 72 | 73 | public class C extends B{ 74 | String name = "C"; 75 | 76 | public String getName(){ 77 | return name; 78 | } 79 | 80 | public void demarreWithSuper() { 81 | System.out.println(super.getName() + " demarre"); 82 | } 83 | 84 | public void demarreNoSuper() { 85 | System.out.println(getName() + " demarre"); 86 | } 87 | } 88 | 89 | public class D extends B{ 90 | public String getName(){ 91 | return name; 92 | } 93 | 94 | public void demarreNoSuper() { 95 | System.out.println(getName() + " demarre"); 96 | } 97 | } 98 | 99 | public class Test { 100 | public static void main(String[] args) { 101 | B b = new B(); 102 | b.demarre(); 103 | 104 | Car bCar = new B(); 105 | bCar.demarre(); 106 | 107 | C c = new C(); 108 | c.demarre(); // c 里并没有定义这个函数 109 | c.demarreWithSuper(); 110 | c.demarreNoSuper(); 111 | 112 | D d = new D(); 113 | d.demarre(); 114 | 115 | transfer(c); // TransferC 116 | transfer((B)c); // TransferB 117 | transfer(d); // TransferB 118 | } 119 | 120 | public static void transfer(B b){ 121 | System.out.println("TransferB"); 122 | b.demarre(); 123 | } 124 | 125 | public static void transfer(C c){ 126 | System.out.println("TransferC"); 127 | c.demarre(); 128 | } 129 | } 130 | } 131 | 132 | 输出是 133 | B demarre 134 | B demarre 135 | C demarre 136 | B demarre 137 | C demarre 138 | B demarre 139 | TransferC 140 | C demarre 141 | TransferB 142 | C demarre 143 | TransferB 144 | B demarre 145 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | 3 | * [介绍](README.md) 4 | * [Java](java/README.md) 5 | * [请说一说 Java](java/what_do_you_know_about_java.md) 6 | * [Java 为什么是高效的?](java/how_java_enabled_high_performance.md) 7 | * [列举出2个 IDE](java/ide.md) 8 | * [面向对象的特征有哪些方面](java/what_ate_object-oriented_features.md) 9 | * [JDK JRE JVM](java/what_is_the_difference_between_a_jdk_and_a_jvm.md) 10 | * [什么是对象 (Object)?](java/what_do_you_mean_by_object.md) 11 | * [一个类是由哪些变量构成的](java/what_kind_of_variables_a_class_can_consist_of.md) 12 | * [静态变量和实例变量的区别?](java/the_difference_between_static_variables_and_instance_variables.md) 13 | * [封装 Encapsulation](java/encapsulation.md) 14 | * [多态 Polymorphism](java/polymorphism.md) 15 | * [构造器是否可以被 override](java/construcor_override.md) 16 | * [接口 Interface](java/interface.md) 17 | * [接口和抽象的区别](java/interfqce_abstraction.md) 18 | * [基础概念题](java/question_interface_1.md) 19 | * [基础程序题](java/question_interface_2.md) 20 | * [super 关键词](java/super_gai_nian.md) 21 | * [super 程序题](java/super_question_1.md) 22 | * [this 程序题](java/this_question.md) 23 | * [抽象 abstract](java/what_is_abstract.md) 24 | * [abstract 相关问题](java/abstract_question.md) 25 | * [this() 和 super() 在构造体里怎么用?](java/how_are_this_and_super_used_with_constructors.md) 26 | * [Static 关键字](java/static.md) 27 | * [Static 相关问题](java/static_questions.md) 28 | * [Singleton 单例模式](java/what_is_singleton_class.md) 29 | * [hashcode 和 equal](java/hashcode__equal.md) 30 | * [== 和 equal 的区别](java/==_equal.md) 31 | * [所有类的基类是哪个类?](java/what_is_the_base_class_of_all_classes.md) 32 | * [Java 支持多继承吗?](java/does_java_support_multiple_inheritance.md) 33 | * [Path 与 Classpath?](java/what_is_difference_between_path_and_classpath.md) 34 | * [反射机制](java/reflection.md) 35 | * [final 关键字](java/final.md) 36 | * [一个. java 源文件是否可以包含多个类](java/java_multi.md) 37 | * [& 与 &&](java/difference_between_and_symbol.md) 38 | * [int 与 integer](java/int_integer.md) 39 | * [integer 通过 == 比较](java/integer_==.md) 40 | * [作用域的区别](java/working_zone.md) 41 | * [异常](java/aaa.md) 42 | * [error 和 exception?](java/error_and_an_exception.md) 43 | * [Checked 异常与 Runtime 异常](java/checked_exception.md) 44 | * [异常概念题](java/exception_question1.md) 45 | * [把对象声明成异常](java/if_i_want_an_object_of_my_class_to_be_thrown_as_an_exception_object,_what_should_i_do.md) 46 | * [处理异常的方法](java/different_ways_to_handle_exceptions.md) 47 | * [每一个 try 都必须有一个 catch 吗?](java/is_it_necessary_that_each_try_block_must_be_followed_by_a_catch_block.md) 48 | * [try 模块里的 return](java/if_i_write_return_at_the_end_of_the_try_block,_will_the_finally_block_still_execute.md) 49 | * [final, finally, finalize的区别](java/final,_finally,_finalize.md) 50 | * [Programme](java/programme.md) 51 | * [输出问题1](java/article11.md) 52 | * [Gabage Collection](java/gabage_collection.md) 53 | * [heap 和 stack](java/heap_stack.md) 54 | * [GC 就一定能保证内存不溢出吗?](java/does_garbage_collection_guarantee_that_a_program_will_not_run_out_of_memory.md) 55 | * [字节流与字符流](java/stream_writer.md) 56 | * [Collection](java/collection.md) 57 | * [ArrayList 和 Vector](java/arraylist_vector.md) 58 | * [HashMap 和 Hashtable](java/hashmap_hashtable.md) 59 | * [HashMap HashTable LinkedHashMap TreeMap](java/hashmap_hashtable_linkedhashmap_treemap.md) 60 | * [Collection 相关问题](java/collection_questions.md) 61 | * [Multi-Thread](java/multi-thread.md) 62 | * [sleep() 和 wait() 的区别](java/sleep_and_wait.md) 63 | * [同步 synchronized](java/synchronized.md) 64 | * [如何实现 muliti-thread?](java/how_to_set_muliti-thread.md) 65 | * [Transient 关键字](java/transient.md) 66 | * [preemptive scheduling 和 time slicing?](java/what_is_the_difference_between_preemptive_scheduling_and_time_slicing.md) 67 | * [一个线程的初始状态是什么?](java/when_a_thread_is_created_and_started,_what_is_its_initial_state.md) 68 | * [synchronized method 和 synchronized statement?](java/what_are_synchronized_methods_and_synchronized_statements.md) 69 | * [守护线程 daemon thread?](java/what_is_daemon_thread_and_which_method_is_used_to_create_the_daemon_thread.md) 70 | * [所有的线程都必须实现哪个方法?](java/what_method_must_be_implemented_by_all_threads.md) 71 | * [Visitor Pattern](java/visitor_pattern.md) 72 | * [Problem on chain](java/probleme_sur_chaine.md) 73 | * [字符串基础问题](java/string_questions.md) 74 | * [StringBuffer 相关问题](java/stringbuffer_questions.md) 75 | * [数组相关问题](java/array.md) 76 | * [序列化 serialization](java/serialization.md) 77 | * [如何序列化一个对象到一个文件?](java/how_do_i_serialize_an_object_to_a_file.md) 78 | * [必须实现 Serializable 接口的哪个方法?](java/which_methods_of_serializable_interface_should_i_implement.md) 79 | * [如何控制 serialization 的过程?](java/how_can_i_customize_the_seralization_process_ie_how_can_one_have_a_control_over_the_serialization_process.md) 80 | * [什么情况下要使用序列化?](java/what_is_the_common_usage_of_serialization.md) 81 | * [Externalizable 接口?](java/externalizable_interface.md) 82 | * [序列化时引用的处理?](java/when_you_serialize_an_object,_what_happens_to_the_object_references_included_in_the_object.md) 83 | * [序列化时要注意什么?](java/what_one_should_take_care_of_while_serializing_the_object.md) 84 | * [序列化时 static 域的处理?](java/what_happens_to_the_static_fields_of_a_class_during_serialization.md) 85 | * [Initialization and Cleanup](java/initialization_and_cleanup.md) 86 | * [Java Data Types](java/java_data_types.md) 87 | * [Run-Time Data Areas](java/run-time_data_areas.md) 88 | * [J2EE](j2ee/README.md) 89 | * [什么是 J2EE?](j2ee/what_is_j2ee.md) 90 | * [J2EE 应用的四个部分?](j2ee/what_are_the_four_components_of_j2ee_application.md) 91 | * [What does application client module contain?](j2ee/what_does_application_client_module_contain.md) 92 | * [What does web module contain?](j2ee/what_does_web_module_contain.md) 93 | * [J2EE客户端有哪些类型](j2ee/what_are_types_of_j2ee_clients.md) 94 | * [Hibernate是什么??](j2ee/what_is_hibernate.md) 95 | * [什么是事务 - transaction](j2ee/-_transaction.md) 96 | * [什么是 servlet?](j2ee/what_is_servlet.md) 97 | * [创建 servlet](j2ee/creat_servlet.md) 98 | * [Servlet 必须实现什么接口?](j2ee/what_must_be_implemented_by_all_servlets.md) 99 | * [Servlet 生命周期?](j2ee/what_are_the_phases_of_the_servlet_life_cycle.md) 100 | * [JSP](j2ee/jsp.md) 101 | * [JSP 的生命周期?](j2ee/jsp_lifecycle.md) 102 | * [JSP 语法](j2ee/jsp_language.md) 103 | * [JSP declarations?](j2ee/what_are_jsp_declarations.md) 104 | * [JSP expressions?](j2ee/jsp_expressions.md) 105 | * [JSP Directives?](j2ee/jsp_directives.md) 106 | * [Types of directive tags?](j2ee/types_of_directive_tags.md) 107 | * [ and <%@ include file = ...>?](j2ee/jsp__include_page_=___and____include_file_=.md) 108 | * [注释的类型](j2ee/types_of_comments.md) 109 | * [JSP Actions?](j2ee/what_do_you_understand_by_jsp_actions.md) 110 | * [ 和 response.sendRedirect(url)?](j2ee/jspforward_page=___responsesendredirecturl.md) 111 | * [Scope for the < jsp : useBean > tag? -](j2ee/scope_for_the__jsp__usebean__tag_-.md) 112 | * [JSP translation?](j2ee/jsp_translation.md) 113 | * [Ear, Jar 和 War 文件?](j2ee/ear,_jar_and_war_files.md) 114 | * [URI 和 URL?](j2ee/uri_url.md) 115 | * [DAO](j2ee/dao.md) 116 | * [Spring](spring/README.md) 117 | * [什么是 Spring?](spring/what_is_spring.md) 118 | * [使用 spring 的好处?](spring/what_are_benefits_of_using_spring.md) 119 | * [Spring 都有哪些模块?](spring/what_are_the_different_modules_in_spring_framework.md) 120 | * [什么是 Spring 的配置文件?](spring/what_is_spring_configuration_file.md) 121 | * [什么是依赖注入 - Dependency Injection?](spring/what_is_dependency_injection.md) 122 | * [IoC 的类型?](spring/ioc_tyoe.md) 123 | * [你更倾向于哪种 DI](spring/which_di.md) 124 | * [IoC 有什么好处?](spring/ioc_good.md) 125 | * [IoC container 是什么?](spring/what_is_spring_ioc_container.md) 126 | * [IoC 容器的类型?](spring/what_are_types_of_ioc_containers_explain_them.md) 127 | * [ApplicationContext 的实现都有哪些?](spring/qc.md) 128 | * [Bean Factory 与 ApplicationContext ?](spring/bf_and_ac.md) 129 | * [什么是 bean?](spring/what_are_spring_beans.md) 130 | * [都有哪些 bean scope?](spring/spring_bean_scope.md) 131 | * [Singleton bean 是线程安全的吗?](spring/are_singleton_beans_thread.md) 132 | * [说下 Bean 的生命周期](spring/bean_lifecycle.md) 133 | * [什么是基于注释的容器配置?](spring/what_is_annotation-based_container_configuration.md) 134 | * [如何注入 Java Collection?](spring/how_can_you_inject_java_collection_in_spring.md) 135 | * [什么是自动装配](spring/autowire.md) 136 | * [什么是 AOP?](spring/what_is_aop.md) 137 | * [通知的类型?](spring/types_of_advice.md) 138 | * [Join point?](spring/join_point.md) 139 | * [Pointcut?](spring/pointcut.md) 140 | * [Introduction?](spring/introduction.md) 141 | * [What does a bean definition contain?](spring/what_does_a_bean_definition_contain) 142 | * [How do you provide configuration metadata to the Spring Container?](spring/how_do_you_provide_configuration_metadata_to_the_spring_container.md) 143 | * [How do add a bean in spring application?](spring/how_do_add_a_bean_in_spring_application.md) 144 | * [What are inner beans in Spring?](spring/what_are_inner_beans_in_spring) 145 | * [How can you inject Java Collection in Spring?](spring/how_can_you_inject_java_collection_in_spring) 146 | * [What are the limitations with autowiring?](spring/what_are_the_limitations_with_autowiring) 147 | * [Can you inject null and empty string values in Spring?](spring/can_you_inject_null_and_empty_string_values_in_spring.md) 148 | * [@Autowired @Inject @Resource](spring/autowired_inject_resource.md) 149 | * [Hibernate](hibernate/README.md) 150 | * [get and load](hibernate/get_and_load.md) 151 | * [什么是 SessionFactory?](hibernate/what_is_sessionfactory_in_hibernate.md) 152 | * [SessionFactory 是线程安全的吗?](hibernate/is_sessionfactory_thread-safe.md) 153 | * [什么是 Session?](hibernate/what_is_session_in_hibernate.md) 154 | * [sorted 与 ordered collection](hibernate/sorted_and_ordered_collection.md) 155 | * [What is the file extension used for hibernate mapping file?](hibernate/what_is_the_file_extension_used_for_hibernate_mapping_file.md) 156 | * [hibernate 的三种状态](hibernate/hibernate_three.md) 157 | * [Linux](linux/README.md) 158 | * [查找文件](linux/find_file.md) 159 | * [列出文件列表](linux/list_file.md) 160 | * [SQL](sql/README.md) 161 | * [设计一对一](sql/one_to_one.md) 162 | * [设计一对多](sql/one_to_multi.md) 163 | * [设计多对多](sql/multi_to_multi.md) 164 | * [都使用过哪些join?](sql/what_type_of_joins_have_you_used.md) 165 | * [inner join](sql/inner_join.md) 166 | * [Left/Right join](sql/leftright_join.md) 167 | * [Full join](sql/full_join.md) 168 | * [合并的问题](sql/union.md) 169 | * [Union all?](sql/union_all.md) 170 | * [Where 和 Having](sql/where_having.md) 171 | * [通配符 wildcard?](sql/what_type_of_wildcards_have_you_used.md) 172 | * [Scrum](scrum/README.md) 173 | * [Scrum 中的三大角色](scrum/scrum_chara.md) 174 | * [What's sprint?](scrum/whats_sprint.md) 175 | * [How to scrum](scrum/how_to_scrum.md) 176 | * [Continuous integration](continuous_integration/README.md) 177 | * [JDBC](jdbc/README) 178 | * [Statement 和 prepared statement?](jdbc/what_is_difference_between_statement_and_prepared_statement.md) 179 | * [Callable statement](jdbc/callable_statement.md) 180 | * [Stored Procedure and how do you call it in JDBC?](jdbc/stored_procedure_and_how_do_you_call_it_in_jdbc.md) 181 | * [What does the Class.forName("MyClass") do?](jdbc/what_does_the_classfornamemyclass_do.md) 182 | * [Connection Pooling ?](jdbc/connection_pooling.md) 183 | * [What are the steps in the JDBC connection?](jdbc/what_are_the_steps_in_the_jdbc_connection.md) 184 | --------------------------------------------------------------------------------