Some famous big companies often have basic interview questions.
I. Basic Java knowledge
1. What are the differences between the basic data types in Java and whether the string type is the basic data type.
Integer literals, floating-point literals, character literals, Boolean literal, string iteral.
String is not a basic data type
2. String operations:
Write a method to reverse the string, for example, input ABC and output CBA.
Public static string reverse (string s ){
Int length = S. Length ();
Stringbuffer result = new stringbuffer (length );
For (INT I = length-1; I> = 0; I --)
Result. append (S. charat (I ));
Return result. tostring ();
}
Write a method to replace the string, for example, input bbbwlirbbb and output bbbhhtccc.
3. Conversion Between Data Types
How to convert numeric characters to numbers (integer, double)
How to convert a number to a character
How to remove the first two decimal places and rounding them out.
4. Date and Time
How to Get year, month, day, hour, minute, second
Date dat = new date ();
Dat. getyear (); dat. getmonth (); dat. getday (); dat. gethours ();...
How to get the number of milliseconds from January 1, 1970 to the present
Long Now = dat. gettime ();
How to obtain a date is the last day of the month
How to format a date
Dateformate df = dateformate. getinstance ();
DF. Format (DAT );
5. arrays and collections
6. file and directory (I/O) Operations
How to list all files in a directory
How to list all subdirectories in a directory
Determine whether a file or directory exists
How to read and write files
7. Implementation of Java polymorphism (inheritance, overloading, and overwriting)
8. encoding conversion, how to convert the gb2312 encoded string to the ISO-8859-1 encoded string.
9. Steps for accessing the database in Java, the difference between statement and preparedstatement.
10. Identify possible errors in the following code and explain the cause:
Ii. jsp & Servlet Technology
1. Describe the differences between JSP and Servlet, their commonalities, and their respective application scopes.
2. What processing should I do when processing HTML tags in web development and filter those characters (<> & ")?
3. How to read client requests, access CGI variables, and determine the actual path of a JSP file in JSP.
4. describe the functions of cookies and sessions, the differences and their respective application scopes, and the working principle of sessions.
5. List the methods in which JSP contains external files. What is the difference between the two.
6. Describe the role and application scope of errorpage in JSP.
7. describes how to use JavaBeans in JSP.
8. A brief introduction to the tag library of JSP
9. How to Implement request forwarding in JSP and Servlet.
Iii. J2EE knowledge
1. Introduce the differences between J2EE, j2se, and j2se.
2. Is J2EE a technology or a platform that provides those technologies.
3. What is application server? What functions and advantages does it have.
4. Briefly introduce the advantages and Principles of the connection pool.
5. Functions of Web. xml
4. Others
1. Web security considerations (Form Verification, browser basic verification, application security, SSL, code considerations)
2. Briefly introduce the MVC you know.
3. Briefly introduce the XML.
4. Documents and coding specifications
5. Paging and efficiency considerations in Java.
6. A brief introduction to structs.
Find out the following program errors.
Class test {
Private string par1;
Private string par2;
Test (){
}
Public static void main (string [] Arg ){
Int;
If (){
System. Out. println ("par1 =" + par1 );
} Else {
System. Out. println ("par2 =" + par2 );
}
}
}