Java interview questions and their answers

xiaoxiao2021-03-06  62

Java foundation:

1, the scope public, private, protected, and the difference between the non-written: Differences: Scope Current class Package children's grandson Other package public √ √ √ √ protected √ √ × × Friendly √ √ × × private √ × × × × Do not write, default is Friendly

2. ARRAYLIST and VECTOR differences, the difference between HashMap and HashTable: ARRAYLIST and Vector are mainly from the second aspect. I. Synchronization: Vector is a thread safe, that is, the synchronization, and arraylist is the line program. Safe, not synchronized two. Data growth: When you need to grow, Vector default growth is the original training, and ArrayList is the original half of Hashmap and HashTable mainly from three aspects. I. Historical reasons: HashTable is an implementation of the old Dictionary class. Hashmap is an implementation of the MAP interface introduced by Java 1.2. Synchronism: HashTable is the thread security, that is, HashMap is not safe. What is not synchronized. Value: Only HashMap allows you to take null values ​​as a key or value of a table.

3, can the CHAR type variable can not store a Chinese Chinese character? Why? A: It is possible to define a Chinese, because Java is encoded in Unicode, a char accounts for 16 bytes, so putting a Chinese is no problem.

4, many threads have several implementations, what is it? Synchronize several implementation methods, what is it? A: Multi-thread has two implementation methods, inheriting the THREAD class and implementing the implementation of the Runnable interface synchronization Species, Synchronized, Wait and Notify

5. Inheriting the order of execution of the class, generally a choice question, ask what you will print? A: Parent class: package test; public class fatherclass {public fatherclass () {system.out.println ("FatherClass Create ");}} subclasses: package test; import test.FatherClass; public class ChildClass extends FatherClass {public ChildClass () {System.out.println (" ChildClass Create ");} public static void main (String [] args) {FatherClass FC = new fatherclass (); childclass cc = new childclass ();}} output: c:> java test.childclass FatherClass Create FatherClass Create ChildClass Create

6, internal class implementation? A: sample code is as follows: package test; public class outerclass {private class interclass {public interclass () {system.out.println ("interclass create");}} public outerclass ()}} IC = new interclass (); system.out.println ("outerclass create");} public static void main (string [] args) {outerclass oc = new outerclass ();}} output: C:> Java Test / OuterClass InterClass Create OuterClass Create a further example:? public class OuterClass {private double d1 = 1.0; // insert code here} You need to insert an inner class declaration at line 3. Which two inner class declarations arevalid (. Choose two) a . class InnerOne {public static double methoda () {return d1;}} B. public class InnerOne {static double methoda () {return d1;}} C. private class InnerOne {double methoda () {return d1;}} D {Return Double methoda () {RETURN D1;}} E. Abstract Class innerone {public Abstract Double Methoda ();} The description is as follows: 1. Static internal class can have static members, not the intact internal classes There is a static member. Therefore, A, B is wrong. The non-static member of the static internal class can access the external class static variables, and the non-static variables of the external class are not accessible; RETURN D1 error.

Therefore, D is not three. Non-static members of non-static internal classes can access unstatic variables of external classes. Therefore, C is correct. The answer is C, E

7. How to optimize the garbage recovery mechanism? I hope everyone will make up, thank you

8, FLOAT FLOAT F = 3.4 is it correct? A: incorrect. The accuracy is not accurate, and it should be converted with a mandatory type, as shown below: float f = (float) 3.4

9. Introduction to Collection Framework in Java (including how to write your own data structure)? A: Collection Framework as follows: Collection ├List │├LINKEDLIST │├ArrayList │ └Vector │ └stack └set map ├Hashtable ├Hashmap └weakhashmap collection is The most basic set interface, a Collection represents a group of objects, ie the collection of the element (Elements) MAP provides mapping of Key to Value

10. Abnormal handling mechanism, event mechanism in Java?

11. Proffles and inheritance in Java? I hope everyone will make up, thank you.

12, abstract class and interface? A: Abstract class and interface are used for abstraction, but the abstract class (Java) can have its own partial implementation, and the interface is completely an identifier (both multiple inheritance functions). 13, Java communication programming, programming questions (or question and answer), programming, read servers several characters, and write to local display? A: Server end program: package test; import java.net. *; Import java.io. *;

public class Server {private ServerSocket ss; private Socket socket; private BufferedReader in; private PrintWriter out; public Server () {try {ss = new ServerSocket (10000); while (true) {socket = ss.accept (); String RemoteIP = Socket.Getinetaddress (). gethostaddress (); string remotEport = ":" Socket.getlocalPort (); system.out.println ("a client com in! ip:" remoteip remoteport); in = new buffredReader New

InputStreamReader (Socket.GetinputStream ()); string line = in.readline (); system.out.println ("Cleint Send IS: line); OUT = New PrintWriter (socket.getputstream (); OUT .println ("Your Message Received!"); out.close (); in .close (); socket.close ();}}} catch (ooException e) {Out.println ("WRONG");}} public static Void Main (String [] args) {new server ();}}; client endpress: package test; import java.io. *; import java.net. *;

Public class client {socket; buffredreader in; printwriter out; public client () {try {system.out.println ("try to connection 127.0.0.1:10000); socket = new socket (" 127.0.0.1 ", 1000); System.out.Println ("The Server Connected!"); System.out.println ("Please Enter Some Character:"); bufferedReader line = new bufferedReader (New

InputStreamReader (System.in)); out = new PrintWriter (socket.getOutputStream (), true); out.println (line.readLine ()); in = new BufferedReader (new InputStreamReader (socket.getInputStream ())); System .out.println (in.readline ()); out.close (); in .close (); socket.close ();} catch (ooException e) {Out.println ("WRONG");}} public static Void main (String [] args) {new client ();}}; 14 As in the Collection framework, what kind of interface is to be achieved? A: Sort by the insertion method is as follows Package Test; import java.util. *; Class insertsort {arraylist al; public insertsort (int Num, int mod) {al = new arraylist (num); random rand = new random () System.out.println ("The ArrayList Sort Before:"); for (int i = 0; i

class SplitString {String SplitStr; int SplitByte; public SplitString (String str, int bytes) {SplitStr = str; SplitByte = bytes; System.out.println ( "The String is: '" SplitStr "'; SplitBytes =" SplitByte } public void splitit () {int loopcount;

LoopCount = (splitstr.length ()% splitbyte == 0)? (splitstr.length () / splitbyte) :( splitstr.length () / split

BYTE 1); System.out.Println ("Will Split INTO" LoopCount; for (int i = 1; i <= loopcount; i ) {if (i == loopcount) {

System.out.println (splitstr.substring ((i-1) * splitbyte, splitstr.length ()));} else {

System.out.println (splitstr.substring ((i-1) * splitbyte, (i * splitbyte)));}}} public static void main (STRING [] args) {splitstring ss = new splitstring ("TEST DDD Wen DSAF Chinese Men 3443N China 43 Chinese

0ewldfls = 103 ", 4); ss.splitit ();}}

16, Java multi-thread programming. Write a multi-thread program with Java, such as writing four threads, two plus 1, two to one variable minus one, output. I hope everyone will make up, thank you.

17, the difference between String and StringBuffer. A: The length of String is invisible, and the length of StringBuffer is variable. If you use the content in the string, especially when you want to modify, use StringBuffer, if you finally need String, use StringBuffer's toString () method JSP aspect

1, what built-in objects do you have? Parameter Response web page Retroate the user's response to the properties of the page to manage the session and request related session period Application Servlet is executing the contents of the OUT to send the response to the SERVLET for the response Config Servlet architecture Page JSP page itself EXCEPTION Page , Unwaped exception

2, what do you have? What is the action? A: JSP has the following six basic action JSP: include: Introducing a file when the page is requested. JSP: Usebean: Find or instantiate a JavaBean. JSP: setProperty: Sets the properties of JavaBean. JSP: getProperty: Outputs the properties of a JavaBean. JSP: Forward: Turn the request to a new page. JSP: Plugin: Generate Object or Embed tags based on the browser type to the Java plugin

3, Dynamic INCLUDE and Static Include in JSP? A: Dynamic include uses JSP: include Page = "incrude.jsp" flush = "true" /> It always checks the changes in the file included, suitable for using dynamic pages, and can bring The parameter static include uses the incrude pseudo code, which does not check the changes in the file included, suitable for containing the static page <% @ include file = "incruded.htm"%>

4, what is the two jump methods? What is the difference? A: There are two kinds, respectively: The frontier page does not turn to the page referred to in INCLUDE, just display the result of the page, the main page is still the original page. It will come back later, which is equivalent to the function call. And can be used with parameters. The latter is completely turned to a new page and will not come back. Equivalent to the GO TO statement.

Servlet

1. Speak the life cycle of servlet? A: servlet has a good definition of life, including loading and instantiation, initialization, processing request, and service end. This survival period is expressed by the init, service, and destroy method of the javax.servlet.servlet interface.

2, the servlet version (forgot what two of the two versions are you)? I hope everyone will make up, thank you.

3, the difference between forward () and redirect () in the Java Servlet API? A: The former is only the steering of the control of control in the container. It does not show the turn-behind address in the client browser address bar; the latter is completely jump, the browser will get the address of the jump, and re-re- Send a request link. Thus, the link address after the jump is seen from the address bar of the browser. Therefore, the former is more efficient, and when the former can meet the needs, try to use the forward () method, and this also helps to hide the actual link. In some cases, for example, you need to jump into a resource on a further server, you must use the sendRedirect () method. 4, Servlet basic structure 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 {}}

JDBC, JDO

1, you may let you write a JDBC even Oracle program and implement data queries. A: The program is as follows: package hello.ant; import java.sql. *; Public class jdbc {string dburl = "JDBC: Oracle: Thin: @ 127.0.0.1: 1521: ORCL "; string theuser =" admin "; string thepw =" manager "; connection c = null; statement conn; result set = null; public jdbc () {Try {class.forname (" Oracle .jdbc.driver.racledriver "). Newinstance (); c = drivermanager.getConnection (DBURL, THEUSER, THEPW); conn = c.createment ();} catch (exception e) {E.PrintStackTrace ();}} PUBLIC boolean executeUpdate (String sql) {try {conn.executeUpdate (sql); return true;} catch (SQLException e) {e.printStackTrace (); return false;}} public ResultSet executeQuery (String sql) {rs = null; try {RS = Conn.executeQuery (SQL);} catch (sqlexception e) {E.PrintStackTrace ();} return} public void close ()} public void close (); c.close ();} catch (Exception E) {E.PrintStackTrace ();}} public static void main (string [] args) {resultset {RSET RS; JDBC conn = new jdbc (); rs = conn.executeQuery ("Select * from test"); TRY {w hile (rs.next ()) {system.out.println (rs.getstring ("id")); system.out.println (rs.getstring ("name"));}} catch (Exception E) {e .printStackTrace ();}}} 2, Class.Forname role? Why is it necessary to use: Call this access Returns a class of classes specified by a string.

3. What is JDO? A: JDO is a new specification for the Java object persistence, which is a referred to as Java Data Object, and is also a standardized API for accessing objects in a data warehouse. JDO provides transparent object storage, so that the developer does not require additional code (such as the JDBC API). These cumbersome routines have been transferred to the JDO product provider, so that developers are freed out to concentrate on time and energy logically. In addition, JDO is flexible because it can run on any data underlayer. JDBC is just more common to relational database (RDBMS) JDO, providing storage capabilities of any data underlying, such as relational database, file, xml, and object database (ODBMS), etc., make it stronger to apply portability.

4. Subject solution in Oracle's large amount of data. Generally, the ID method is used, and there is a three-layer nested method. A: One page method <% int i = 1; int number = 14; string pages = request.getParameter ("page"); int currentpage = 1; currentpage = (Pages == NULL)? (1): {Integer .PARSEINT (PAGES)} SQL = "SELECT Count (*) from Tables"; ResultSet RS = DBLINK.EXECUTEQUERY (SQL); while (rs.next ()) i = rs.Getint (1); int intelectCount = 1; ? intPageCount = (i% numPages == 0) (i / numPages) :( i / numPages 1); int nextPage; int upPage; nextPage = currentPage 1; if (nextPage> = intPageCount) nextPage = intPageCount; upPage = CurrentPage-1; if (UPPage <= 1) UPPAGE = 1; rs.close (); SQL = "Select * from Tables"; rs = dblink.executeQuery (SQL); i = 0; While ((i // Output content // Output page connection total: <% = currentpage%> / <% = intPageCount%> "> Previous <% for (int J = 1; J < = INTPAGECUNT; J ) {IF (CurrentPage! = j) {%> Next page

javax.xml.parsers.DocumentBuilderFactory.newInstance () newDocumentBuilder ();. org.w3c.dom.Document doc = builder.newDocument (); org.w3c.dom.Element root = doc.createElement ( "teacher"); org .w3c.dom.Element Wang = doc.createElement ("King"); org.w3c.dom.Element Liu = Doc.createElement ("Liu"); wang.Appendchild (Doc.createTextNode ("I am Teacher Wang") ); root.appendChild (wang); doc.appendChild (root); javax.xml.transform.Transformer transformer = javax.xml.transform.TransformerFactory.newInstance () newTransformer ();. transformer.setOutputProperty (javax.xml.transform .Outputkeys.encoding, "gb2312"); transformer.setputProperty (javax.xml.transform.outputKeys.indent, "Yes");

Transformer.Transform (New Javax.xml.Transform.dom.Domsource (DOC), NEW

Javax.xml.transform.Stream.StreamResult (outfile);} catch (exception e) {system.out.println (E.getMessage ());}}}

4, programming uses Java to parse the way XML method. A: Use SAX mode to parse XML, XML files are as follows: Wang Xiaoming Information College 6258113 Male, born in 1955, Ph.D., marked in Hainan University Event callback class saxhandler.java import java.io. *; import java.util.Hashtable; import org.xml.sax *;. public class SAXHandler extends HandlerBase {private Hashtable table = new Hashtable (); private String currentElement = null; private String currentValue = null; public void setTable (Hashtable table) {this.table = table;} public Hashtable getTable () {return table;} public void startElement (String tag, AttributeList attrs) throws SAXException {currentElement = tag;} public void characters (char [] ch, int start, int length) throws SAXException {currentValue = new String (ch, start, length);} public void endElement (String name) throws SAXException {if (currentElement.equals (name)) table.put (currentElement, currentValue);}} JSP Content display source code, saxml.jsp: Analyze XML file people.xml </ t ITLE> </ head @ body> <% @ page errorpage = "errpage.jsp" contenttype = "text / html; charSet = GB2312"%> <% @ Page Import = "java.io. *"%> <% @Page Import = "java.util.hashtable"%> <% @ page import = "org.w3c.dom. *"%> <% @ page import = "org.xml.sax. *"%> <% @ Page Import = "javax.xml.parsers.saxparserfactory"%> <% @ page import = "javax.xml.parsers.saxparser"%> <% @ page import = "saxhandler"%> <</p> <p>% File file = new File ( "c: /people.xml"); FileReader reader = new FileReader (file); Parser parser; SAXParserFactory spf = SAXParserFactory.newInstance (); SAXParser sp = spf.newSAXParser (); SAXHandler handler = New saxhandler (); sp.PARS (New InputSource (Reader), Handler; HashTable HashTable = Handler.getTable (); Out.Println ("<Table Border = 2> <Caption> Teacher Information Table </ CAPTION>") Out.println ("<tr> <TD> Name </ TD>" "<TD>" (String) Hashtable.Get (New String ("Name") "</ TD> </ TR> "); out.println (" <tr> <TD> College </ TD> " " <TD> " (String) HashTable.Get (New String (" College ") " </ TD> </ Tr> "); out.println (" <tr> <TD> Phone </ TD> " " <TD> " (String) HashTable.Get (New String (" Telephone ") " </ TD> </ TR> "); out.println (" <tr> <TD> Remarks </ TD> " " <TD> " (String) Hashtable.Get (New String (" notes ") " </ TD> </ tr> "); out.println (" </ table> ");%> </ body> </ html> EJB</p> <p>1. What are the contents of EJB2.0? What is the difference between EJB2.0 and EJB1.1? A: The specification includes the bean provider, the application assembly, EJB container, EJB configuration tool, EJB service provider ,System administrator. In this regard, the EJB container is the core of EJB. The EJB container manages EJB creation, undo, activation, deactivation, and the database connection, etc. Important work. JSP, Servlet, EJB, JNDI, JDBC, JMS .....</p> <p>2, the difference between EJB and Java Bean? A: Java bean is a reused component, which does not have a strict specification for Java Bean. In theory, any Java class can be a bean. In general, since the Java bean is created (such as Tomcat) by the container, the Java Bean should have a 11-free constructor, in addition, the Java Bean also implements the Serializable interface to implement the persistence of beans. Java Bean is actually equivalent to the COM component in the local process in the Microsoft COM model, which cannot be accessed across the process. Enterprise Java Bean is equivalent to DCOM, ie distributed components. It is based on Java-based remote method call (RMI) technology, so EJB can be remotely accessed (cross processes, cross-computers). But EJB must be deployed in a container such as WebSpere, WebLogic, and EJB customers never access true EJB components, but access them through their container. The EJB container is an agent of EJB components, and the EJB component is created and managed by the container. The client accesses the real EJB component through the container. 3, EJB A basic structure: an EJB comprises three parts: Code package Beans Remote Interface interface; import javax.ejb.EJBObject; import java.rmi.RemoteException; public interface Add extends EJBObject {// some method declare} Home Code package Beans Interface interface; import java.rmi.RemoteException; import jaax.ejb.CreateException; import javax.ejb.EJBHome; public interface AddHome extends EJBHome {// some method declare} EJB class code package Beans; import java. RMI.RemoteException; import javax.ejb.sessionBean; import javx.ejb.sessionContext; public class addbean imports sessionbean {// some method Declare}</p> <p>J2EE, MVC</p> <p>1, all parts of the MVC have those technologies to achieve? How to implement? A: MVC is a short written by Model-View-Controller. "Model" is the application's business logic (implemented by javabean, ejb component), "view" is the application's representation surface (generated by JSP page), "Controller" is a process control (generally a servlet) The application logic, processing procedure, and display logic are achieved by this design model into different components. These components can interact and reuse.</p> <p>2, the difference between application servers and web server? I hope everyone will make up, thank you.</p> <p>3, what is J2EE? A: JE22 is a multi-dimi-Diered, distributed, distributed, component-based, based on Component-Base, in which an application system can follow Function is divided into different components that can be on different computers and are in the corresponding hierarchy (TIER). The hierarchies are included in the ClientN Tier components, web layers, and components, Business layers, and components, and corporate information systems (EIS) layers. 4. Web service noun explanation. JSWDL development package. JAXP, JAXM explanation. SOAP, UDDI, WSDL Explanation. A: Web Service Description Language WSDL SOAP, Simple Object Access Protocol, is a lightweight protocol for exchange XML encoding information. The purpose of UDDI is to establish standards for e-commerce; UDDI is a web-based, distributed, implementation standard specification provided by the information registry for Web Service, and also includes a group of web services that can provide themselves. Register to achieve the implementation of the access protocols that other companies can discover.</p> <p>5, links and differences between BS and CS. I hope everyone will make up, thank you.</p> <p>6, Struts Application (such as Struts Architecture) A: Struts is a Framework that uses Java Servlet / JavaServer Pages technology to develop web applications. The Struts can develop an application architecture based on MODEL-View-Controller design mode. Struts has the following main functions: I contain a controller servlet to send the user's request to the corresponding Action object. II.Jsp Free Tag Library and provide association support in the Controller Servlet to help developers create interactive form applications. 3. Provide a series of practical objects: XML processing, automatically handle JavaBeans properties, international tips and messages through Java Reflection APIs.</p> <p>Design mode</p> <p>1. During the development, the design mode is used? What are the occasions? A: Each mode describes a problem that has emerged in our environment and then describes the core of the solution. In this way, you can use the existing solutions countlessly without counting the same job. Mainly used in the design pattern of MVC. Used to develop JSP / Servlet or J2EE related applications. Simple factory model, etc.</p> <p>2, UML Answer: Standard Modeling Language UML. Model example, static map (including class diagram, object map, and package), behavioral map, interaction map (sequential diagram, cooperation map), implementation diagram,</p> <p>JavaScript</p> <p>1. How to check the digital model? Var RE = / ^ D {1,8} $ | .d {1, 2} $ /; 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);}</p> <p>CORBA</p> <p>1, what is CORBA? What is the use? A: CORBA standard is a common object request agency architecture, which is standardized by the object management organization (Object Management Group, abbreviated as OMG). Its composition is the interface definition language (IDL), language binding (binding: also translated into a cable) and an agreement to interoperate interoperability. Its purpose is to use different programming languages ​​to write in different processes to develop in different processes.</p> <p>Linux</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-84711.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="84711" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.048</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'seOZdjpJG_2BgKpUHKHPe2_2Ftuq8lVf71O940bePRH4wktHCvOrHFdm5xJA0uKmvxCklTX1wG_2Fa6S2vFDrHySowww_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>