Java Interview Summary

Source: Internet
Author: User
Tags tmp folder

Java Basic topics:

1. After executing the following statements, the values of I and n are, int i=10;int n=i++%5;

Results: i=11,n=0

2, for the following code which expression return value is True:b

public class sample{

Long length;

Public Sample (Long L) {length=l;}

public static void Main (String[]args)

{

Sample S1,s2,s3;

S1=new Sample (211);

S2=new Sample (211);

S3=S2;

}

}

A S1==S2

B S2.equals (S3)

C s1.equals (S2)

D S2!=S3

Note: = = differs from equals:

(1) = = is an operator, Equals is a method of a String object

(2) Basic data type comparison: = = and equals are compare two values are equal, equal to true, not equal to False

(3) Reference object comparison: = = and equals are both equal in the comparison stack memory, equal to true, not equal to False

(4) string is a special type of reference. For a comparison of two strings, = = and equals compare two strings in the same way.

(5) When you create two string objects, the addresses in memory are not the same, but you can assign the same values. So, the same string, the address is not necessarily the same, in turn is positive.

3. The maximum length of the VARCHAR2 type in Oracle is (4000)

4. Which of the following options contains 7 levels of the OSI model in order

Physical layer, Data link layer, network layer, transport layer, Session layer, presentation layer, application layer

5. When a client closes a connection obtained from a connection pool, it will find one of the following:

The connection does not close, but simply gives the connection pool

6. You use the mkdir command to create a temporary folder/tmp/aaa and copy some files into it. To delete the/mnt/tmp folder and all files in it after you have used it, you should use the command

Rm-r/TMP/AAA

7, the following about the system concurrent access number estimation data that most effective: B

A. Peak hours day processing volume of business 100000
B. Peak hour average of requests per second 80
C. Simultaneous online users 100
D. Average number of user requests per second 50

8. PL/SQL is used to determine if the FETCH statement is successful, and when the FETCH statement fails, the property that returns the logical true is:%notfound

%isopen
%notfound
%rowcount
%found
9, the following program code description is correct: D
1. public class hasstatic{
2. private static int x=100;
3. public static void Main (String args[]) {
4. Hasstatic hs1=new hasstatic ();
5. hs1.x++;
6. Hasstatic hs2=new hasstatic ();
7. hs2.x++;
8. Hs1=new hasstatic ();
9. hs1.x++;
hasstatic.x--;
System.out.println ("x=" +x);
12.}
13.}
A. The program is compiled and the output is: x=103
B. 10 rows cannot be compiled because X is a private static variable
C. 5 rows cannot be compiled because a private static variable is referenced
D. The program is compiled and the output is: x=102

10. Define string: String s1= "Hello"; The following procedure is described correctly:

if (s1== "Hello") {
System.out.println ("S1 = \" Hello\ "");
}else{
System.out.println ("S1!=hello");
}
A. Output S1!=hello
B. Compile correctly, run error
C. Generating compilation errors
D. Output s1= "Hello"

Note: \ Print out, otherwise the program compiles an error

11. What are the descriptions of garbage collection? B

A. Garbage collection can release memory that is used by Java objects at the desired time.
B. Garbage collection checks and frees memory that is no longer in use.
C. Garbage collection allows the program developer to explicitly specify and immediately release the memory.
D. Program developers must create a thread for their own memory release work.

12, if you configure a servlet to use the parameters, preferably in which method to load? A

A. Init
B. Doget
C. destory
D. DoPost
E. Service

Note: The execution principle and life cycle of servlet

http://blog.csdn.net/javaloveiphone/article/details/8154791

13. Which of the following declaration of the class is wrong? A

A. Class MyClass extends MySuperClass1, MySupperClass2 {}
B. public class myclass{}
C. Abstract class MyClass implements YourInterface1, Youriterface2 {}
D. Private class MyClass {}
E. Class MyClass extends Mysuperclass implements Yourinterface {}

14, the following statement is correct (c)
A. Java threads are non-preemptive
B. Threads in Java are not allowed to share data
C. Each Java program has at least one thread, the main threaded
D. Threads in Java can not share code

15. The following statements function as follows: C
Select Ename,sal from emp WHERE sal< (select min (sal) from EMP) +1000
A. Show employee information for wages less than $1000
B. A 1000 increase in wages of employees less than $1000 shows
C. Show employee information not exceeding minimum wage of $1000
D. Display of employee information exceeding minimum wage of $1000

16, perform the following pl/sql,emp table in the existence of the employee number 1234, the correct is: B

Declare
V_name VARCHAR2 (10);
Begin

SELECT ename to v_name from emp WHERE empno= ' 1234 ';
Dbms_output.put_line (' found ');
EXCEPTION
When No_data_found Then
Dbms_output.put_line (' not found! ');

Dbms_output.put_line (' others ');

End

A. Program compilation Error
B. The output is: found
C. The output is: not found others
D. The output is: found others

17, which of the following map is sorted: A

A. TreeMap
B. HashMap
C. Hashtable
D. Weakhashmap
E. Linkedhashmap

Note: Java's Common toolkit has java.util,java.io,java.sql,java.net,java.lang,java.math,java.awt,java.applet,javax.swing

Java.util:http://wenku.baidu.com/view/f9b9927d1711cc7931b716b6.html?re=view

Java.io:http://wenku.baidu.com/view/3886f9e919e8b8f67c1cb907.html

Java.sql:http://docs.oracle.com/javase/7/docs/api/java/sql/package-summary.html

Java.net:http://baike.baidu.com/link?url=ib6cu4ezbwvqus64c__wezaxm6y_4z_kndbpgpfw6a0mnqnlep2v3oa_ qdb2pen4hedkldsggur_rniipnqz2q

Java.lang:http://wenku.baidu.com/link?url= Dwfe4nxbh8-obq5atkkbsvkhbpdq0zedtppnkz8tkzjubdlwub31a5o1ubps8azf5r83ji54jwe_bchxydpumiawf0l2tyit2ijl3j_n3qu

Java.awt:http://wenku.baidu.com/view/e5df8e7d1711cc7931b716c8.html?re=view

java.applet:http://blog.csdn.net/slience_perseverance/article/details/7606654

Javax.swing:http://wenku.baidu.com/view/7306c558be23482fb4da4ce5.html?from=search

---restore content ends---

Java Interview Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.