腾讯面试
This commit is contained in:
@ -41,21 +41,27 @@ public class Test {
|
||||
private int a;
|
||||
|
||||
public static void main(String[] args) {
|
||||
//System.out.println(foo());
|
||||
int r = new Test().foo();
|
||||
System.out.println(r);
|
||||
PriorityBlockingQueue<Integer> aa;
|
||||
LinkedBlockingQueue<Integer> ss;
|
||||
ss = new LinkedBlockingQueue<>();
|
||||
ss.add(1);
|
||||
ArrayBlockingQueue<Integer> s;
|
||||
LinkedBlockingQueue<Integer> a;
|
||||
FileInputStream fis;
|
||||
FileOutputStream fos;
|
||||
InputStreamReader isr;
|
||||
OutputStreamWriter osw;
|
||||
float b = Math.round(11.5);
|
||||
System.out.println(b);
|
||||
// //System.out.println(foo());
|
||||
// int r = new Test().foo();
|
||||
// //System.out.println(r);
|
||||
// PriorityBlockingQueue<Integer> aa;
|
||||
// LinkedBlockingQueue<Integer> ss;
|
||||
// ss = new LinkedBlockingQueue<>();
|
||||
// ss.add(1);
|
||||
// ArrayBlockingQueue<Integer> s;
|
||||
// LinkedBlockingQueue<Integer> a;
|
||||
// FileInputStream fis;
|
||||
// FileOutputStream fos;
|
||||
// InputStreamReader isr;
|
||||
// OutputStreamWriter osw;
|
||||
// float b = Math.round(11.5);
|
||||
// //System.out.println(b);
|
||||
|
||||
int[] t = new int[]{1,2};
|
||||
int[] temp = t;
|
||||
System.out.println(t[0]);
|
||||
t[0]= 10;
|
||||
System.out.println(temp[0]);
|
||||
}
|
||||
|
||||
public int foo() {
|
||||
|
@ -1,15 +1,9 @@
|
||||
package com.raorao.java;
|
||||
|
||||
import clojure.lang.Obj;
|
||||
import com.google.common.collect.HashBasedTable;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
public class Test implements Serializable {
|
||||
@ -29,10 +23,10 @@ public class Test implements Serializable {
|
||||
hashMap.put(2, 20);
|
||||
hashMap.put(3, 30);
|
||||
hashMap.put(19, 30);
|
||||
hashMap.forEach((e1, e2)-> System.out.println( e1 + ":" + e2));
|
||||
hashMap.forEach((e1, e2) -> System.out.println(e1 + ":" + e2));
|
||||
Iterator<Entry<Integer, Integer>> iterator = hashMap.entrySet().iterator();
|
||||
Enumeration<Integer> enumeration = hashMap.elements();
|
||||
while (enumeration.hasMoreElements()){
|
||||
while (enumeration.hasMoreElements()) {
|
||||
System.out.println(enumeration.nextElement());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user