OCA

An array does not override equals() and so uses object equality. ArrayList does override equals() and defines it as the same elements in the same order.
 
StringBuilder does not implement the equals method.
 
!! dates are immutable and the plus methods have their return values ignored, the result is unchanged.
 

private methods are always hidden in a subclass.

variables may only be hidden, regardless of the access modifier.

The interface variable amount is correctly declared, with public and static being assumed and automatically inserted by the compiler

Although all variables in interfaces are assumed to be public static final, abstract classes may contain them as well

though an instance of an object that implements an interface inherits java.lang.Object, the interface itself doesn't; otherwise, Java would support multiple inheritance for objects, which it doesn't.

The trick here is that the method fly() is marked as private in the parent class Bird, which means it may only be hidden, not overridden. With hidden methods, the specific method used depends on where it is referenced.

Runtime exceptions can be thrown in any method

ArrayIndexOutOfBoundsException, IllegalArgumentException, and NumberFormatException are runtime exceptions.

the method called inside the try block doesn't declare an IOException to be thrown. The compiler realizes that IOException would be an unreachable catch block.

IOException is a subclass of Exception, but not a RuntimeException.

All array types are reference variables. Although int is a primitive type, int[] is still a reference type.

What data types allowed in a switch statement?

In a StringBuilder, the length can be less than or equal to the capacity.  What is capacity??

NumberFormatException is RuntimeException ?

Overload: It prefers an auto boxed parameter over a vararg parameter.

Method has protected access, which means it can only be accessed from a  subclass reference or in the same package.

Why abstract class can have constructor method since it cannot be instantiated??

IllegalArgumentException is a runtime exception.

Java is pass by value, reassignments to method parameters are not seen by caller.

An interface method can be overridden with an abstract method that follows the particular rules for method overriding.

A class implements two interfaces can have duplicate abstract and static method

A class implements two interfaces can only have a duplicate default method if the class override the default method.

The initial capacity of StringBuilder is 16.

byte is -127 , 128

Two -dimention arrays, the second length won’t limit the length??

int [][] ints2 = new int[1][1];

ints2[0] = new int[] {4, 5, 6};

NegativeArraySizeException

NumberFormatException is RuntimeException.

??  Interface I

I i = new I(){};

Public StringBuilder append(char[] str, int offset, int len)

Error/exception throw by JVM??

IllegalStateException (which is a RuntimeException) and AssertionError can be thrown programmatically. ??

A fully qualified means using the complete package details when access a Java class.

The native keyword is applied to a method to indicate that the method is implemented using native code using JNI (Java Native Interface) ??

What is keyword - transient ?

  • transient is a Java keyword which marks a member variable not to be serialized when it is persisted to streams of bytes. When an object is transferred through the network, the object needs to be 'serialized'. Serialization converts the object state to serial bytes.
 
spliterator was introduced in ArrayList in Java SE8.
 
The default capacity of ArrayList is 10.
The default capacity of HashMap is 16.
Integer class caches values between -128, 127
 
 
 
OCP
 
An outer class showing all types of inner classes that it can define: inner class, static nested class, local inner class, and anonymous inner class

Flavors of inner classes and their definitions

Type of inner class

Description

Static or static nested class Is a static member of its enclosing class and can access all the static variables and members of its outer class
Inner or member class Is an instance member of its enclosing class. It can access all the instance and static members of its outer class, including private members.
Method local inner class Is defined within a method. Local inner classes are local to a method. They can access all the members of a class, including its private members, but they can be accessed only within the method in which they’re defined.
Anonymous inner class Is a local class without a name

A variable of primitive type or type String, that is final and initialized with a compile-time constant expression (§15.28), is called a constant variable.
 
Inner classes may not declare static members, unless they are constant variables (§4.12.4), or a compile-time error occurs.
 
If an anonymous inner class extends a class, it subclasses it explicitly. When it implements an interface, it implicitly extends class java.lang.Object. If an anonymous inner class doesn’t subclass a class implicitly, it implicitly extends java.lang.Object.
 
 
The creation of enum constants happens in a static initializer block, before the execution of the rest of the code defined in the static block. Here’s the decompiled code for enum BasicColor, which shows how enum constants are initialized in the static block. To initialize an enum constant, its constructor is called. Note that the contents of the default constructor and instance initializer blocks are added to the new constructor implicitly defined during the compilation process
 
 
 
Table 3.3. Classes and methods from the Java API that use the Factory pattern

Class

Method

Description

java.util.Calendar getInstance() Gets a calendar using the default time zone and locale.
java.util.Arrays asList() Returns a fixed-size list backed by the specified array.
java.util.ResourceBundle getBundle() Overloaded versions of this method return a resource bundle using the specified base name, target locale, class loader, and control.
java.sql.DriverManager getConnection() Establishes and returns a connection to the given database URL.
java.sql.DriverManager getDriver() Attempts to locate and return a driver that understands the given URL.
java.sql.Connection createStatement() Overloaded version of this method creates a statement object for sending SQL statements to the database and generates ResultSet objects with the given type, concurrency, and holdability.
java.sql.Statement executeQuery() Executes the given SQL statement, which returns a single ResultSet object.
java.text.NumberFormat getInstance() getNumberFormat() Returns a general-purpose number format for the current default locale.
java.text.NumberFormat getCurrencyInstance() Returns a currency format for the current default locale.
java.text.NumberFormat getIntegerInstance() Returns an integer format for the current default locale.
java.util.concurrent.Executors newFixedThreadPool() newCachedThreadPool() newSingleThreadExecutor() Creates a thread pool.
The compiler erases the type information by replacing all type parameters in generic types with Object (for unbounded parameter types) or their bounds (for bounded parameter types). The compiler might insert type casts to preserve type safety and generate bridge methods to preserve polymorphism in extended generic types.
 
Bridge methods

The Java compiler might need to create additional methods, referred to as bridge methods, as part of the type erasure process.

===================================================
Figure 8.4. Comparing class Paths and interface Path

Figure 10.4. Main methods of class Thread

Figure 10.7. Identifying parts of runtime data that can be shared across threads

Table 11.2. Mapping of classes and interfaces from package java.util.concurrent and its corresponding package java.util analog

Package java.util.concurrent

java.util analog

BlockingQueue Queue
ArrayBlockingQueue Queue
LinkedBlockingQueue Queue
ConcurrentMap Map
ConcurrentHashMap HashMap
ConcurrentSkipListMap TreeMap
CopyOnWriteArrayList ArrayList
LinkedBlockingDeque Deque

 
 
Classes implemented in the fork/join framework

 

OCA & OCP Notes的更多相关文章

  1. OCA,OCP,OCM傻傻分不清?

    可能大家知道OCA.OCP.OCM的关系是一个比一个难考,一个比一个含金量高,但是你知道具体的考试科目.考试方式.就业形势区别吗?不知道的话这篇通俗易懂的文章会让你一目了然. 区别一:含金量 ■OCA ...

  2. Miscellaneous Articles

    标记一下,慢慢看  http://www.oracle-base.com/articles/misc/articles-misc.php Miscellaneous Articles DBA Deve ...

  3. 工作8年对技术学习过程的一些 总结 与 感悟 为什么有时迷茫、无奈 学习编程语言的最高境界最重要的是编程思想 T 字发展 学技术忌讳”什么都会“ 每天进步一点等式图 时间管理矩阵

    工作这些年对技术学习过程的一些 总结 与 感悟(一) 引言 工作了8年,一路走来总有些感触时不时的浮现在脑海中.写下来留个痕迹,也顺便给大家一点参考.希望能给初学者一点帮助. 入门 进入计算机行业,起 ...

  4. DBA 招聘

    数据库管理员(资深) 眼控科技 10-19万 72小时反馈 上海 6小时前 大专及以上 2年以上经验 普通话 25-35岁 绩效奖金 带薪年假 午餐补助 定期体检 年底双薪 五险一金 职位描述: 工作 ...

  5. 数据库之Oracle的介绍与使用20180620

    /*******************************************************************************************/ 一.orac ...

  6. Oracle入门第一天(上)——简介与安装

    一.Oracle介绍  Oracle 公司是全球最大的信息管理软件及服务供应商,成立于1977年 Oracle 公司因其复杂的关系数据库产品而闻名.Oracle的关系数据库是世界第一个支持SQL语言的 ...

  7. OCP/OCA Oracle 学习001

    select * from TEST3 t select object_type, count(object_type) from user_objects group by object_type ...

  8. ocp 1Z0-042 121-178题解析

    121. You want to create a new optimized database for your transactional production environment to be ...

  9. ocp 1Z0-042 1-60题解析

    1. Because of a power outage,instance failure has occurred. From what point in the redo log does rec ...

随机推荐

  1. 关于IO的操作(文件、网络)

    IO操作的流程总结和分析: (1)对象,易于编写代码    --->   (2)byte[],底层本质   ---->  (3)IO(文件.网络),最终IO处理掉

  2. oracle归档空间

    select GROUP_NUMBER, NAME, STATE, TOTAL_MB-FREE_MB as USED_MB, FREE_MB, USABLE_FILE_MB from v$asm_di ...

  3. hdu 2018 母牛的故事 动态规划入门题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2018 设 f[i][j] 表示第i天年龄为j的母牛个数,其中j=4代表所有年龄达到4岁的成年母牛,则: ...

  4. HTML布局水平导航条1制作

    该文是用css制作个导航条,用竖线分隔,导航条是点击的多个区块.步骤:ul里设置需要数量的li,li中加上a链接给ul加样式,去掉默认的前面的点给li设置左浮动,让ul里的li横向排列a链接设置成块状 ...

  5. Centos7网络连接

    参考链接:http://baijiahao.baidu.com/s?id=1597809303775176940(上面有些没说清楚,所以简化总结一丢丢) Step1 编辑 — 虚拟网络编辑器 — (管 ...

  6. CF1277D Let's Play the Words?

    思路: 字符串其实只有0...0, 0...1, 1...0, 1...1四种. 实现: #include <bits/stdc++.h> using namespace std; ]; ...

  7. 利用卷积神经网络处理cifar图像分类

    这是一个图像分类的比赛CIFAR( CIFAR-10 - Object Recognition in Images ) 首先我们需要下载数据文件,地址: http://www.cs.toronto.e ...

  8. svn钩子(hooks)

    目录 钩子脚本的具体写法就是操作系统中shell脚本程序的写法,请根据自己SVN所在的操作系统和shell程序进行相应的写作 所谓钩子就是与一些版本库事件触发的程序,例如新修订版本的创建,或是未版本化 ...

  9. 几个有益的 CSS 小知识

    样式的顺序 CSS 代码:   HTML 代码:   记得之前这是一道比较火的 CSS 考题,当时好像是有不少的人答错(30% 以上) 答案你们应该是知道的. 可以这样提升 CSS 性能 后代选择器 ...

  10. 两个gif图片动画效果

    <div className="uploading-animation-tip-wrap"> <img src={require('~/shared/assets ...