Job DAY017

A, JavaScript short answer questions

Topic Copywriter: Tell us about the split () and join () function of the difference?

answer:

(1) split () for dividing a character string, returns an array,

E.g

var string=“hello world?name=xiaobai”;

var splitString = string.split("?");

console.log(splitString);//["hello world","name=xiaobai"]

When split () is only one parameter: a string or a regular expression segmentation; when two parameters, the second parameter is the number of elements in the returned array;

(2) join () for connecting a plurality of characters or character strings, the return value is a string;

E.g

var arr= new Array();

arr[0]="hello";

arr[1]="xiao";

arr[2]= "bai";

arr.join("&");//"hello&xiao&bai"

join (); // default delimiter is a comma;

 

Two, Java short answer questions

Topic Copywriting: Java What are the basic data types, String is not the basic data types, what is the difference between them?

A: Java basic data types are divided into: type integer, floating-point type, character type, Boolean type these four types.

       String class is not the basic data type, but a class (class), is C ++, java programming language like strings.

       Basic data type (e.g., int, boolean, double, etc.) is that the difference between String memory. String is stored in an array, each of the contents of the array represents a character of the string; int variables are stored in a few bytes.

Three, JSP short answer questions

Topic Copywriting: Describe the difference between forward and redirect?

answer:

1, different requestor

redirect: client-initiated requests

forward: server-initiated request

2, the performance of different browsers address

redirect: the browser displays the requested address

urlforward: the browser address does not display the requested url

3, different transmission parameters

redirect: a restart request, the end of the life cycle of the original request page.

forward: time forward another connection. request variable is in its life cycle. You can also use another page, and its essence is the target address include. 

4, the underlying operation of the different

redirect: request for information sent back to the client and allow the client and then forwarded to another resource, a need to increase the communication between the server and the client.

forward: direct server side to find the target, and include over.

5, different definitions

Direct forwarding mode (Forward): The client browser and only make a single request, Servlet, HTML, JSP, or other resource information, the resource by the second information in response to the request, the request in the request object, for each information object stored resources are shared.

Indirect forwarding mode (Redirect) is twice the actual HTTP request, the server in response to the first request, let the browser again another URL request, so as to achieve the purpose of forwarding.

Guess you like

Origin www.cnblogs.com/fighting2015/p/11349924.html