Job DAY006

A, JavaScript quiz

Topic Copywriting: What is NaN, what type it is? How to test whether a value equal to NaN?

A: NaN property on behalf of a "not a number" value. Type is Number.

       Test method (1) using the built-in function isNaN (). (2) value !== value, if the value is equal NaN, it will only have true. In addition, ES6 provides a new  Number.isNaN() function, which is a different function than the old global and  isNaN() more reliable function.

Two, MySQL essay questions

Topic copy: The difference drop, delete and truncate the?

answer:

One, delete

. 1, is the DML delete, delete operation is performed, each row deleted from the table, and simultaneously records the row delete operation for rollback (ROLLBACK) and redo operations in the redo and undo table space, but Note that the table space is large enough, you need to manually submit (commit) operations to take effect, you can undo the operation by the rollback.

2, delete to delete the table according to the conditions to meet the conditions of the data, if you do not specify the where clause, then delete all records in the table.

3, delete statement does not affect the table occupied by the extent, high waterline (high watermark) remain unchanged original position.

二、truncate

1, truncate is DDL, implicitly submit, therefore, can not be rolled back, not fire the trigger.

2, truncate will delete all records in the table, and will be re-set the high-water line and all the indexes, by default minextents free up space to a extent, unless reuse storage ,. The log does not record, so the execution is very fast, but can not be undone by rollback operation (if accidentally truncate a table out, also can be restored, but can not rollback to restore).

3, the foreign key for the table (ForeignKey) constraint references can not be used truncate table, and use the delete statement without a where clause.

4, truncatetable not be used to participate in a table indexed view.

Three, drop

1, drop a DDL, implicitly submit, therefore, can not be rolled back, not fire the trigger.

2, drop statement to delete all table structure and data, and the release of all the space occupied by the table.

3, drop statement removes a table structure-dependent constraints, triggers, indexes, depending on the table stored procedure / function will be retained, but becomes invalid state.

Three, Java programming problem

Title copy: a sequence Score: 2 / 1,3 / 2,5 / 3,8 / 5,13 / 8,21 / 13 ... and this calculated front 20 of the series. 

A: (1) code is as follows

Package Package1; 

public  class COUNT {
      public  static  void main (String [] args) {
             // definition of the sum of the denominator, molecules, temporary storage variable denominator   
            Double SUM = 0, H = 2, K =. 1, TEMP = 0 ;  
             for ( Double I =. 1; I <= 20 is; I ++ ) {   
                sUM + = H / K;   
                TEMP = H;   
                H = H + K;   
                K = TEMP;   
            }       
            System.out.println ( "before the number of columns 20 and of : "+ SUM);   
        } 
}

       (2) Results screenshot

 

Guess you like

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