甲骨文笔试精华汇总
DutyDate
-----------
HouseKeeperID
WorkStatus
AlternateHID
AlternateWorkSt
------------
Housekeeper
HouseKeeperID
HouseKeeperName
SupervisorID
Supervisor
SupervisorID
SupervisorName
Duty
DutyID
FloorNo
DutyDate
Transaction
DutyID
------------
HouseKeeperID
WorkStatus
AlternateHID
AlternateWorkSt
------------
Housekeeper
HouseKeeperID
HouseKeeperName
Supervisor
SupervisorID
SupervisorName
Duty
DutyID
FloorNo
DutyDate
Transaction
DutyID
HouseKeeperID
WorkStatus
AlternateHID
AlternateWorkSt
Oracle笔试题
Which of the following can contain duplicate values?
ArrayList HashSet TreeSet
A, B & C
B and C
A
A and C
---------------
Which of the following can contain duplicate values?
ArrayList HashSet TreeSet
www.qz26.com
A, B & C
B and C
A
A and C
---------------------------
public class Group {
ArrayList contents;
public Group() {
lst = new java.util.ArrayList();
};
public void add(String s) {
/* code to add something to contents here */
};
public void reverse() {
/* code to reverse the contents here */
};
}
public class GroupUser extends Thread {
Group group;
public GroupUser(Group g) {
group = g;
}
public void changeGroup() {
/* code that calls group.add() several times then group.reverse() */
}
public void run() {
for (int i = 0; i < 10; i++) changeGroup();
}
}
public static void main(String args[]) throws InterruptedException {
Group g = new Group();
new GroupUser(g).start();
new GroupUser(g).start();
new GroupUser(g).start();
}
Which of the following changes could you make to the code to prevent the three threads
started by main from interfering with each other’s use of the shared Group instance
(provided by main) in GroupUser.changeGroup?
Question Number 17 add the keyword synchronized before void in GroupUser.changeGroup add the
keyword synchronized before void in both Group.add and Group.reverse
--------------
public class Group {
ArrayList contents;
public Group() {
lst = new java.util.ArrayList();
www.qz26.com
};
public void add(String s) {
/* code to add something to contents here */
};
public void reverse() {
/* code to reverse the contents here */