Core Java 2】的更多相关文章

import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.Font; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.URL; import javax.swing.JApplet; import javax.swing.JBu…
1.2. The Java "White Paper" BuzzwordsThe authors of Java have written an influential White Paper that explains their design goals and accomplishments. They also published a shorter summary that is organized along the following 11 buzzwords:1. Si…
4.7. PackagesJava allows you to group classes in a collection called a package. Packages are convenient for organizing your work and for separating your work from code libraries provided by others.The standard Java library is distributed over a numbe…
This is a new series of sharing core Java interview question and answer on Finance domain and mostly on big Investment bank.Many of these Java interview questions are asked on JP Morgan, Morgan Stanley, Barclays or Goldman Sachs. Banks mostly asked c…
今天起开始学习Java,学习用书为Core Java.之前有过C的经验.准备把自己学习这一本书时的各种想法,不易理解的,重要的都记录下来.希望以后回顾起来能温故知新吧.也希望自己能够坚持把自己学习这本书的整个过程记录下来. I want to put a ding in the universe. 基本术语:       Object Oriented Programming——OOP——面向对象编程 Application Programming Interface——API——应用程序编程接…
Java里面的String Conceptually, Java Strings are sequences of Unicode characters. Java里面的String都是Unicode字符串 Java does not have a built-in string type. java没有内建的字符串类型. Each quoted string is an instance of the String class. 每个引用的字符串都是一个String类的实例. 字符串是永恒的:…
We are sharing 25 java interview questions , these questions are frequently asked by the recruiters.Java questions can be asked from any core java topic . So we try our best to provide you the java interview questions and answers for experienced whic…
Difference between Vector and Arraylist is the most common  Core Java Interview question you will come across in Collection .  This question is mostly used as a start up question by the Interviewers before testing deep  roots of  the Collection  .Vec…
Core Java (十一) Java 继承,类,超类和子类 标签: javaJavaJAVA 2013-01-22 17:08 1274人阅读 评论(0) 收藏 举报  分类: java(58) 读书笔记(46)  版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[+]   继承关系 两个类之间存在三种关系: 依赖,uses-a,如果一个类的方法操纵另一个对象,我们就说一个类依赖于另一个类. 聚合(关联),has-a,一个对象包含另外一个对象,聚合关系意味着类A的对象包含类…
Core Java的那点事儿之ArrayList 万丈高楼平地起,Java基础要拿起.今天就从我看的Core Java里找了些小基础点来分享一下. 首先隆重介绍一下专业级龙套演员---Employee类(PS:我可是专注龙套30年),下面会有多次出场,因此先在此介绍一下: class Employee{ private String name; private double salary; private int id; //下面是set.get方法 } ArrayList 首先有请ArrayL…
初始化空 初始化创建 一把锁 两把锁 大专栏  Core Java之7种单例模式"headerlink" title="静态内部类">静态内部类 静态加载 枚举…
说起Java的HashMap相信大家都不是很陌生,但是对于HashMap内部结构有些同学可能不太了解,咱们下一步就将其展开. HashMap是基于Hash算法的,同理的还有HashSet和HashTable.我的一篇博文讲述了如果将Object作为Key的话,那么就需要注意重写其hashCode()和equals()方法,当然,这个equals()不是必要重写的,但是在Effective Java中这条是一条准则.那么针对这块有个问题,如果只写了hashCode方法不写equals或者反之呢?…
说起Java 7的Executors框架的线程池,同学们能想到有几种线程池,它们分别是什么? 一共有四个,它们分别是Executors的 newSingleThreadPool(), newCachedThreadPool(), newFixedThreadPool(),newScheduledThread(),四个静态方法,当然在java 8中还有一个newWorkStealingThreadPool(). 但今天这些这些不是咱们今天要说的重点,今天要说的重点是里边所使用的ThreadPool…
Base: OOA是什么?OOD是什么?OOP是什么?{ oo(object-oriented):基于对象概念,以对象为中心,以类和继承为构造机制,来认识,理解,刻画客观世界和设计,构建相应的软件系统的一门方法;本意----模拟人类的思维方式,使开发,维护,修改更加容易 ­     ooa(object-oriented analysis):强调的是在系统调查资料的基础上,针对OO方法所需要的素材进行的归类分析和整理,而不是 对管理业务现状和方法的分析-------其实就是进一步对oo进行细化,…
2016-10-19 说说&和&&的区别 初级问题,但是还是加入了笔记,因为得满分不容易. &和&&都可以用作逻辑与的运算(两边是boolean类型),全真则真,一假则假. &&还具有短路的功能,即第一个表达式为false,则不再计算第二个表达式.例如, if(str != null&& !str.equals("")) 当str为null时,后面的表达式不会执行,不会出现NullPointerExcept…
2016-10-18 整理 写一个程序判断整数的奇偶 public static boolean isOdd(int i){ return i % 2 == 1; } 百度百科定义:奇数(英文:odd)数学术语 ,口语中也称作单数, 整数中,能被2整除的数是偶数,不能被2整除的数是奇数,奇数个位为1,3,5,7,9.偶数可用2k表示,奇数可用2k+1表示,这里k就是整数.奇数可以分为: 正奇数:1.3.5.7.9.11.13.15.17.19.21.23.25.27.29.31.33......…
所有代码均在本地编译运行测试,环境为 Windows7 32位机器 + eclipse Mars.2 Release (4.5.2) 2016-10-17 整理 字符,字符串类问题 正则表达式问题 Java字符编码问题 字符串内存问题 简述String和StringBuffer.StringBuilder的区别? 比较初级的一个题目,而初级题目又是除高端职位外,笔试题海量筛人的首选,但是作为经典题目,还是入选了我的笔记,因为它能延伸的Java字符串的问题太多了--另一种延伸的高端问法就是套路你,…
所有代码均在本地编译运行测试,环境为 Windows7 32位机器 + eclipse Mars.2 Release (4.5.2) 2016-10-17 整理 下面的代码输出结果是多少?为什么?并由此总结几个编程规范. class smallT { public static void main(String args[]) { smallT t = new smallT(); int b = t.get(); System.out.println(b); } public int get()…
前言 译文链接:http://www.journaldev.com/2366/core-java-interview-questions-and-answers Java 8有哪些重要的特性 Java 8发布于2014年3月,这块内容在Java面试中非常常见.如果你能清晰的回答这方面的问题,说明you are not out,喜欢学习最新的技术.Java 8是继Java 5的注解和泛型之后所做的最大的改动,主要的新特性如下: 1.接口支持静态方法和默认方法 2.函数式接口和Lambda表达式 3…
0. 概述: Java中基于流的I/O构建在4个抽象类之上, 其中2个是字节流,另外2个是字符流. 字节流: InputStream / OutputStream 当操作字节或其它二进制对象时,应当使用字节流. 字符流: Reader / Writer 当操作字符或字符串时,应当使用字符流. 1. InputStream InputStream:   输入字节流,它是一个抽象类. 常用主要方法: int read() 返回代表下一个可用字节的整数,当文件达到末尾时,返回-1. int read(…
5.1. Classes, Superclasses, and SubclassesLet's return to the Employee class that we discussed in the previous chapter. Suppose (alas) you work for a company at which managers are treated differently from other employees. Managers are, of course, jus…
4.10. Class Design HintsWithout trying to be comprehensive or tedious, we want to end this chapter with some hints that will make your classes more acceptable in well-mannered OOP circles. 1. Always keep data private. This is first and foremost; doin…
4.6. Object ConstructionYou have seen how to write simple constructors that define the initial state of your objects. However, since object construction is so important, Java offers quite a variety of mechanisms for writing constructors. We go over t…
4.5. Method ParametersLet us review the computer science terms that describe how parameters can be passed to a method (or a function) in a programming language. The term call by value(值调用) means that the method gets just the value that the caller pro…
4.4. Static Fields and MethodsIn all sample programs that you have seen, the main method is tagged with the static modifier. We are now ready to discuss the meaning of this modifier.4.4.1. Static Fields(静态域)If you define a field as static, then there…
4.1. Introduction to Object-Oriented ProgrammingObject-oriented programming, or OOP for short, is the dominant programming paradigm these days, having replaced the "structured," procedural programming techniques that were developed in the 1970s.…
3.10. ArraysAn array is a data structure that stores a collection of values of the same type. You access each individual value through an integer index. For example, if a is an array of integers, then a[i] is the ith integer in the array.Declare an a…
3.8. Control FlowJava, like any programming language, supports both conditional statements and loops to determine control flow. We will start with the conditional statements, then move on to loops, to end with the somewhat cumbersome switch statement…
3.6. StringsConceptually, Java strings are sequences of Unicode characters(Java的字符串是一个Unicode序列). For example, the string "Java\u2122" consists of the five Unicode characters J, a, v, a, and ?. Java does not have a built-in string type(Java没有内置的…
3.5. OperatorsThe usual arithmetic operators +, -, *, / are used in Java for addition, subtraction, multiplication, and division. The / operator denotes integer division if both arguments are integers, and floating-point division otherwise. Integer r…