Sun River
          Topics about Java SE, Servlet/JSP, JDBC, MultiThread, UML, Design Pattern, CSS, JavaScript, Maven, JBoss, Tomcat, ...
          posts - 78,comments - 0,trackbacks - 0

          Question How do you delete a Cookie within a JSP? (JSP)

          Answer

          Cookie mycook = new Cookie("name","value");

          response.addCookie(mycook);

          Cookie killmycook = new Cookie("mycook","value");

          killmycook.setMaxAge(0);

          killmycook.setPath("/");

          killmycook.addCookie(killmycook);

          Question How many types of protocol implementations does RMI have? (RMI)

          Answer RMI has at least three protocol implementations: Java

          Remote Method Protocol(JRMP), Internet Inter ORB Protocol(IIOP),

          and Jini Extensible Remote Invocation(JERI). These are alternatives,

          not part of the same thing, All three are indeed layer 6 protocols for

          those who are still speaking OSI reference model.

          Question What are the different identifier states of a Thread?

          (Core Java)

          Answer The different identifiers of a Thread are:

          R - Running or runnable thread

          S - Suspended thread

          CW - Thread waiting on a condition variable

          MW - Thread waiting on a monitor lock

          MS - Thread suspended waiting on a monitor lock


          Question What is the fastest type of JDBC driver? (JDBC)

          Answer JDBC driver performance will depend on a number of

          issues:

          (a) the quality of the driver code,

          (b) the size of the driver code,

          (c) the database server and its load,

          (d) network topology,

          (e) the number of times your request is translated to a different API.

          In general, all things being equal, you can assume that the more your

          request and response change hands, the slower it will be. This

          means that Type 1 and Type 3 drivers will be slower than Type 2

          drivers (the database calls are make at least three translations versus

          two), and Type 4 drivers are the fastest (only one translation).

          Question Request parameter How to find whether a parameter

          exists in the request object? (Servlets)

          Answer 1.boolean hasFoo = !(request.getParameter("foo") ==

          null || request.getParameter("foo").equals(""));

          2. boolean hasParameter =

          request.getParameterMap().contains(theParameter);

          (which works in Servlet 2.3+)


          Question How can I send user authentication information while

          makingURLConnection? (Servlets)

          Answer You’ll want to use

          HttpURLConnection.setRequestProperty and set all the appropriate

          headers to HTTP authorization.

          Question How do I convert a numeric IP address like 192.18.97.39

          into a hostname like java.sun.com? (Networking)

          Answer

          Question How many methods do u implement if implement the

          Serializable Interface? (Core Java)

          Answer The Serializable interface is just a "marker" interface,

          with no methods of its own to implement. Other ’marker’ interfaces

          are

          java.rmi.Remote

          java.util.EventListener

          String hostname =InetAddress.getByName("192.18.97.39").getHostName();

          posted on 2010-10-25 17:08 Sun River 閱讀(293) 評論(0)  編輯  收藏 所屬分類: Interview Preparation
          主站蜘蛛池模板: 石楼县| 鹤岗市| 阜新| 威信县| 漠河县| 类乌齐县| 嫩江县| 来凤县| 视频| 义马市| 诸暨市| 武陟县| 克什克腾旗| 莱芜市| 兰西县| 咸阳市| 漯河市| 焉耆| 正镶白旗| 石嘴山市| 铜山县| 商都县| 宜宾县| 大田县| 昌吉市| 杭锦旗| 衡南县| 彭阳县| 讷河市| 东明县| 普格县| 腾冲县| 塘沽区| 保定市| 鄂温| 旬阳县| 名山县| 广州市| 乌兰察布市| 巴林左旗| 康马县|