September 7, 2014
Today I started reading this book, interrupted the original plan of the middle level of the system training, I think first look at the face test. Give the book a a drop first.
Read a day, probably read half, a little disappointed, because this book explains the interview is the basis of the foundation, I looked worried, the author is difficult to go deep into the system level to talk about technology, are some superficial articles.
But I've sorted out some of the more detailed things for you.
The fifth chapter begins:
-----------------------------------------------------
ClassLoader knowledge.
The parent class delegate is used for the overall invocation. Why is it so used? security and avoid repeated loading .
That is classlader when the JVM is started,bootstrap Classlader (class loader-load), user-defined ClassLoader,
Forget it, I searched a good explanation of http://blog.csdn.net/changewang/article/details/6107507
--------------------
Unicode-encoded storage is used in the JVM. In the case of external systems, the InputStream and other classes (where the file reads into the boundary) are encoded to be converted when the readout is read. Windows is GBK encoded.
---------------------
int j=0;j=j++;//j=0. The Cache intermediate variable is similar to the temp =jj=j+1;j=temp;
-----------------
/* * The priority problem of the increment operator * */int i=0;int y=i++ +i++ +i++ +i++; System.out.println (y); 0 +1 +2+3 =6 each step + operation, and then self-increment + +, from left to right calculation, not all at once all out, then + +, pay attention to i=0;y=i++ +i++ + ++i; System.out.println (y); ++i first, high Priority 1 + 2 + 1=4
/* * Output is 9.0 because the trinocular operation is defined by the return value of 10.0 for the double type, so the output of the X>5=false is 9.0 */int x=5; SYSTEM.OUT.PRINTLN ("data =" + ((x>5) 10:9));
/* * Trinocular operator return value is constant, 103 is constant, not int!!! , then G will also be specified as a constant output */char g= ' g '; int l=103; System.out.println (FALSE?L:G); 103system.out.println (FALSE?103:G); G
/* * The base data type is a copy of the value of the * object type, including string, which is a reference copy *output Ab-b * Look at the results to know */string a=new String ("a"); StringBuffer B1 = new StringBuffer (a); StringBuffer b2 = new StringBuffer ("B"); New Test (). Operate (B1, B2); SYSTEM.OUT.PRINTLN (B1 + "-" + B2); B1=ab b2=b/* * && | | With a short-circuit operator, if the first expression is already able to determine the entire expression, the compiler skips the subsequent expression. * & | ^ is not just a bitwise operator, but also a Boolean logical operator. Non-short-circuit operator */int M=5,n=5;if ((m==5) | | (n++) ==5); System.out.println ("C.") +N); C.5if ((m==5) | (n++) ==5); System.out.println ("C.") +N); c.6/* * int is 4 bytes, 32 bits, and >>n moves n bits to the right. Each move one bit/2 operation * I.E. sum>>32 to the right 32, a loop. is still sum=32 * */int sum=32; System.out.println (SUM>>32); System.out.println (sum>>5);//5= 1system.out.println (sum>>6); 6~31 = 0/* * Remember a Microsoft face question (x-1) &x problem * 1.x binary rightmost 1. Each time you execute (x-1) &x, you can count 1 of the number of * 2.if (X-1) &x to determine whether the index is 2 * * /int t1=32;if (((t1-1) &t1) ==0 ("is the index of 2"); System.out.println; In binary, there are only 1 1int cnt=0;//statistics for the number of binary 1 while (t1!=0) {t1=t1& (t1-1); cnt++;} System.out.println ("The number of binary 1 is" +cnt);/* * There is also an algorithm commonly used to determine the parity, to quickly scroll the array, thus saving space of * (x-1) &1 odd = 0 even = 1 so the result is only 0, 1. More examples. Just remember (x-1) &1 can judge the parity, and 0,1 is the result, some use in the future * *
All right. Embarrassed, sleepy, I rest to 、、、 tomorrow to continue.
Java Programmer interview Summary-Talk about my understanding.