File tree Expand file tree Collapse file tree
basics/UnsafeTest/unsafe_voliate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,15 @@ public static void main(String[] args) {
4141 int unsafeInt = unsafe .getInt (UnsafeTestTwo .class , anLong );
4242 System .out .println ("anInt: " + unsafeInt );
4343 System .out .println ("anLong : " + anLong );
44- unsafeTestTwo .testSys ();
44+ /* unsafeTestTwo.testSys();*/
45+ try {
46+ UnsafeTestTwo o = (UnsafeTestTwo ) unsafe .allocateInstance (UnsafeTestTwo .class );
47+ //2055281021 --- 1554547125
48+ System .out .println ("true or false :" +o .hashCode () + " hash" + unsafeTestTwo .hashCode ());
49+ /* o.testSys();*/
50+ } catch (InstantiationException e ) {
51+ e .printStackTrace ();
52+ }
4553 }
4654
4755 public void testSys () {
Original file line number Diff line number Diff line change 11package com .sun .proxy ;
22
3+ import java .util .ArrayList ;
4+ import java .util .List ;
5+
36/**
47 * @PACKAGE_NAME: com.sun.proxy
58 * @PROJECT_NAME: JavaCode
69 * @Date: 2018/4/9
710 * @author: chenzhuo
811 */
9- public class Test {
12+ public class Test <T > {
13+ public void main (String [] args ){
14+ List <Integer > list = new ArrayList <>();
15+ list .add (1 );
16+ }
17+
1018}
You can’t perform that action at this time.
0 commit comments