张孝祥Java就业面试题大全.pdf_第1页
张孝祥Java就业面试题大全.pdf_第2页
张孝祥Java就业面试题大全.pdf_第3页
张孝祥Java就业面试题大全.pdf_第4页
张孝祥Java就业面试题大全.pdf_第5页
已阅读5页,还剩66页未读 继续免费阅读

张孝祥Java就业面试题大全.pdf.pdf 免费下载

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n ajax Java Java 2000 4500 4000 7000 7000 1 2 3 4 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n blog blog blog Java 1 Java io 97 java public public 10 i 10 i for int j 0 j 10 j System out println i i j j if j 5 break ok boolean found false for int i 0 i 10 i for int j 0 j 10 j System out println i i j j if j 5 found true break 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 42 switch byte long String switch expr1 expr1 int Integer byte short char int long String sitch int swtich 25 short s1 1 s1 s1 1 short s1 1 s1 1 short s1 1 s1 s1 1 s1 1 int short s1 short s1 1 s1 1 java java 55 char char Unicode unicode char unicode char unicode char 44 2 8 2 3 n 2 n 8 3 cpu 2 8 2 3 2 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n byte 1 128 127 1 11111111 1 Java 1 11111110 byte 11111110 2 128 10000000 128 Java 1 00000000 byte 00000000 0 Java byte int a Integer MAX VALUE int b Integer MAX VALUE int sum a b System out println a a b b sum sum long int 2 31 2 1000 1000 1000 20 public class BigInteger int sign byte val public Biginteger String val sign val public BigInteger add BigInteger other public BigInteger subtract BigInteger other public BigInteger multiply BigInteger other 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n public BigInteger divide BigInteger other jdk java math BigInteger 112 final final final StringBuffer a new StringBuffer immutable a new StringBuffer a append broken public void method finalStringBufferparam param append a 101 equals Objet obj new Object obj new Object 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n equals String a new String foo String b new String foo new a b a b a b false a equals b true String input input equals quit equals equals Object equals Object equals boolean equals Object o return this o equals equals Object equals false equals 104 static staticVar staticVar 1 instanceVar instanceVar instanceVar 1 public class VariantTest public static int staticVar 0 public int instanceVar 0 public VariantTest staticVar instanceVar System out println staticVar staticVar instanceVar instanceVar 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 106 static static static static static static static static static static 1 Integer int int java 8 Java Integer java int int 0 Integer null Integer 0 int 0 Integer JSP Integer null el int 0 el 0 int web Integer Integer 26 Math round 11 5 Math round 11 5 Math ceil floor round ceil Math ceil 11 3 12 Math ceil 11 3 11 floor Math ceil 11 6 11 Math ceil 11 6 12 round Math floor x 0 5 0 5 Math round 11 5 12 Math round 11 5 11 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 1 public private protected friendly package package public protected friendly private 4 4 14 Overload Override Overloaded Overload Override Overload Override Overloaded Overloaded Override map remove key remove java 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 40 Constructor override Constructor Override Overload 34 implements concrete class main implements main java 107 clone clone super clone 6 4 1 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n Person class Person String name int age UserDao userDao daofactory getDao UserJdbcDao UserHibernateDao userDao userDao insertUser UserJdbcDao insertUser UserHibernateDao insertUser UserDao userDao daofactory getDao userDao insertUser user 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 102 java 17 abstract class interface abstract class abstract abstract abstract class abstract class abstract class abstract interface public abstract public static final 1 2 3 4 public protected public public abstract 5 6 public static public static 7 Servlet Servlet service public abstract class BaseServlet extends HttpServlet publicvoidservice HttpServletRequestrequest HttpServletResponseresponse throws IOExcetion ServletException if try 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n doService request response catch Excetpion e protected abstract void doService HttpServletRequest request HttpServletResponse response throws IOExcetion ServletException protected public class MyServlet1 extends BaseServlet protectedvoiddoService HttpServletRequestrequest HttpServletResponseresponse throws IOExcetion ServletException Servlet 6 37 abstract method static native synchronized abstract method static static native abstract FileOutputSteam api windows c jdk FileOutputStream open private native void open String name throws FileNotFoundException synchronized abstract synchronized 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 3 c public class Outer int out x 0 public void method Inner1 inner1 new Inner1 class Inner2 public method out x 3 Inner2 inner2 new Inner2 public class Inner1 public protecte private 4 4 Outer outer new Outer Outer Inner1 inner1 outer new Innner1 final abstract final eclipse static Static Nested Class Static Nested Class public protected private public 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n Static Nested Class Static Nested Class Inner Outer Static Nested Class Inner Outer Inner inner new Outer Inner static Nested Class static Nested Class static Static Nested Class Static Nested Class Static Nested Class static public class Outer public void start new Thread new Runable public void run start 121 class Outer static int x static class Inner void test syso x 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 21 Static Nested Class Inner Class 115 Anonymous Inner Class extends implements interface 2 String byte int char long float double boolean short java lang String final StringBuffer 111 String s Hello s s world String String immutable s String Hello s s s String Hello world s 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n String String String StringBuffer new String s String public class Demo private String s public Demo s Initial Value s new String Initial Value String String String s Java String new String String Java Java StringBuffer 41 String String final 27 String s new String xyz String Object New String 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 5 String StringBuffer JAVA String StringBuffer String StringBuffer StringBuffer StringBuffers String equals new String abc equals new String abc true StringBuffer equals new StringBuffer abc equals new StringBuffer abc false 1 100 StringBuffer sbf new StringBuffer for int i 0 i 100 i sbf append i StringBuffer 101 String str new String for int i 0 i 100 i str str i 3 jdk api 1 String result orgStr split 2 StingTokenizer StringTokenizertokener StringTokenizer orgStr String result new String tokener countTokens Int i 0 while tokener hasNext result i toker nextToken 38 length String length length length String length 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 43 try return try finally code return return publicclass Test param args add by zxx Dec 9 2008 public static void main String args TODO Auto generated method stub System out println new Test test static int test int x 1 try return x finally x 1 12 final finally finalize final 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n final finally finalize Object JVM 5 java 15 error exception error exception 50 Java JAVA JAVA JAVA 2 JAVA IndexOutOfBoundsException null NullPointerException JAVA throw java lang Thowable 33 runtime exception ArithmeticException ArrayStoreException BufferOverflowException BufferUnderflowException CannotRedoException CannotUndoException ClassCastException CMMException ConcurrentModificationException DOMException EmptyStackException IllegalArgumentException IllegalMonitorStateException 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n IllegalPathStateException IllegalStateException ImagingOpException IndexOutOfBoundsException MissingResourceException NegativeArraySizeException NoSuchElementException NullPointerException ProfileDataException ProviderException RasterFORMatException SecurityException SystemException UndeclaredThrowableException UnmodifiableSetException UnsupportedOperationException 96 JAVA throws throw try catch finally try Java Java Throwable Java 5 try catch throw throws finally try throws catch finally try try catch throw throws Finally try try try try try try 99 java stop suspend new Thread new Thread runnable thread run Thread new SubThread runnable run Thread Runnable 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n synchronized stop suspend suspend suspend Thread wait notify 13 sleep wait sleep Thread sleep wait Object wait notify notifyAll 16 17 class Test synchronized static void sayHello3 synchronized void getX 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 56 Thread Runnable synchronized wait notify wait lock sleep InterruptedException notify JVM Allnotity 30 run start start JVM run 47 synchronized 1 synchronized 2 wait synchronized 3 synchronized wait 58 Java 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 71 synchronized java util concurrent locks Lock Lock synchronized Lock synchronized synchronized Lock finally 28 4 j 1 j 1 j public class ThreadTest1 private int j public static void main String args ThreadTest1 tt new ThreadTest1 Inc inc tt new Inc Dec dec tt new Dec for int i 0 i 2 i Thread t new Thread inc t start t new Thread dec t start private synchronized void inc j System out println Thread currentThread getName inc j private synchronized void dec j System out println Thread currentThread getName dec j class Inc implements Runnable public void run for int i 0 i 100 i inc 本页已使用福昕阅读器进行编辑 福昕软件 C 2 0 0 5 2 0 0 9 版权所有 仅供试用 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n class Dec implements Runnable public void run for int i 0 i 78 def 62 xyz 65 hashSet 62 65 78 LinkedHashSet hashcode hashset hashcode equals new Student HashSet HashSet size hashcode equals size Vector HashSet 7 ArrayList Vector LinkedList ArrayList Vector Vector synchronized ArrayList LinkedList 4 Vector Vector newVector new Vector 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n For int i 0 i5000 return System out println n multiply n 2 System out println n Gaibaota N Gaibaota N 1 n 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 7 2 帮 帮希 微 帮 微 放 package cn itcast import java util Date public class A1 public static void main String args System out println computeAge 8 public static int computeAge int n if n 1 return 10 return computeAge n 1 2 public static void toBinary int n StringBuffer result 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n if n 2 0 toBinary n 2 result result append n 2 94 JAVA public class QuickSort param strDate param left param right public void quickSort String strDate int left int right String middle tempDate int i j i left j right middle strDate i j 2 do while strDate i compareTo middle 0 if i j tempDate strDate i strDate i strDate j strDate j tempDate i j while i j if ileft quickSort strDate left j param args public static void main String args String strVoid new String 11 66 22 0 55 22 0 32 QuickSort sort new QuickSort sort quickSort strVoid 0 strVoid length 1 for int i 0 i strVoid length i System out println strVoid i 7 a n java package cn itcast lecture2 import java util Arrays import java util Collections public class ReverseTest public static void main String args 0 1000 int data new int int Math random 1000 int Math random 1000 int Math random 1000 int Math random 1000 int Math random 1000 int Math random 1000 int Math random 100 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n System out println Math random System out print System out println Arrays toString data reverse data System out print System out println Arrays toString data data 1 n 2 n 1 public static void reverse int data int len data length for int i 0 i public class RenMingBi param args add by zxx Nov 29 2008 private static final char data new char private static final char units new char public static void main String args 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n TODOAuto generated method stub System out println convert 135689123 public static String convert int money StringBuffer sbf new StringBuffer int unit 0 while money 0 sbf insert 0 units unit int number money 10 sbf insert 0 data number money 10 return sbf toString 2 html var str document form1 all i value var r str match re if r null sign 4 break else document form1 all i value parseFloat str 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 3 Java web 1 HTTP GET POST servlet javax servlet Servlet init service destroy 62 servlet servlet javax servlet Servlet init service destroy 1 Servlet servlet javax servlet Servlet init service destroy Servlet init service service doXXX doGet doPost destroy web servlet servlet init servlet service do web servlet destroy 4 Servlet public class ServletName extends HttpServlet public void doPost HttpServletRequest request HttpServletResponse response throws ServletException IOException public void doGet HttpServletRequest request HttpServletResponse response throws ServletException IOException 3 SERVLETAPI forward redirect 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n forward sendRedirect 60 doGet doPost Jsp FORM method get doGet post doPost 66 Request setAttribute String name Object name request getAttribute String name name getAttributeNames request getCookies Cookie Cookie getCharacterEncoding getContentLength Body getHeader String name HTTP getHeaders String name request Header getHeaderNames request Header getInputStream getMethod getParameter String name name getParameterNames getParametervalues String name name getProtocol getQueryString getRequestURI getRemoteAddr IP getRemoteHost getSession Boolean create Session getServerName getServletPath getServerPort removeAttribute String name 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 19 forward redirect forward URL URL redirect session request 4 request getAttribute request getParameter 1 jsp JSP 9 request GET POST response pageContext session application servlet out config servlet page JSP exception request HttpServletRequest cookie header session response HttpServletResponse cookies out javax jsp JspWriter pageContext javax servlet jsp PageContext servlet API servlet session javax servlet http HttpSession Session applicaton javax servle ServletContext servlet 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n servlet config javax servlet ServletConfig servlet page servlet 2 jsp JSP 6 jsp include jsp useBean JavaBean jsp setProperty JavaBean jsp getProperty JavaBean jsp forward jsp plugin Java OBJECT EMBED 59 JSP isErrorPage Exception isELIgnored 3 JSP INCLUDE INCLUDE INCLUDE jsp include INCLUDE include 4 forward sendRedirect 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n include go to 63 request session application cookie 64 JSP Servlet JSP Servlet Servlet JSP servlet Servlet JSP Servlet Java HTML JSP Java HTML jsp JSP Servlet 1 MVC MVC Model View Controller Model JavaBean EJB View JSP Controller Servlet 68 web iso8859 1 Public String translate String str String tempStr try tempStr new String str getBytes ISO 8859 1 GBK tempStr tempStr trim catch Exception e System err println e getMessage 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n return tempStr 1 n reset 4 1 2 union union all Drop table if not exists employees create table employees id int primary key auto increment name varchar 50 salary int managerid int references employees id insert into employees values null zxx 10000 null null lhm 15000 1 null flx 9000 1 null tg 10000 2 null wzg 10000 3 Wzg flx lhm zxx select e from employees e employees m where e managerid m id and e sala ry m salary 3 oracle 1 3 teacher student tea stu teacher teaID name age student stuID name age teacher student teaID stuID sql 1 name age 2 age 40 age 12 的T的T的T的T 问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n问ttp查 www客it部ast客部n 1 sql select insert delete update 2 drop table if exists tea stu drop table if exists teacher drop table if exists student create table teacher teaID int primary key name varchar 50 age int create table student stuID int primary key name varchar 50 age int create table tea stu teaID int references teacher teaID stuID int references student stuID insert into teacher values 1 zxx 45 2 lhm 25 3 wzg 26 4 tg 27 insert into student values 1 wy 11 2 dh 25 3 ysq 26 4 mxc 27 insert into tea stu values 1 1 1 2 1 3 insert into tea stu values 2 2 2 3 2 4 insert into tea stu values 3 3 3 4 3 1 insert into tea stu values 4 4 4 1 4 2 4 3 2 3 3 2 4 3 1 select teaid count from tea stu group by teaid 2 40 1 1 tea stu teaID teaID teacher teaID 1 1 4 3 select from tea stu teacher where tea stu teaID teacher teaID 40 select from tea stu teacher where tea stu teaID teacher teaID and teacher age 40 3 12 select from select tea stu from tea stu teacher where tea stu teaID teacher teaID and teacher age12 4 id select t teaID count from select tea stu from tea stu teacher where tea stu teaID teacher teaID and teacher age12 gr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论