6
Q:

In the following pieces of code, B and D will compile without any error. True or false ?

A: StringBuffer sb1 = "abcd";

B: Boolean b = new Boolean("abcd");

C: byte b = 255;

D: int x = 0x1234;

E: float fl = 1.2;

 

A) TRUE B) FALSE

Answer:   A) TRUE



Explanation:

The code segments B and D will compile without any error. A is not a valid way to construct a StringBuffer, you need to create a StringBuffer object using "new". B is a valid construction of a Boolean (any string other than "true" or "false" to the Boolean constructor will result in a Boolean with a value of "false"). C will fail to compile because the valid range for a byte is -128 to +127 (i.e., 8 bits, signed). D is correct, 0x1234 is the hexadecimal representation in java. E fails to compile because the compiler interprets 1.2 as a double being assigned to a float (down-casting), which is not valid. You either need an explicit cast, as in "(float)1.2" or "1.2f", to indicate a float.

Q:

Go command is a signal to execute the entire batch of SQL statements after previous Go

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:
Report Error

View Answer Workspace Report Error Discuss

0 3094
Q:

Explain Data Control Language

Answer

Data Control Language (DCL):-statements to take care of the security and authorization.


Examples:



    1. GRANT

    2. REVOKE

Report Error

View answer Workspace Report Error Discuss

2 1940
Q:

Explain Data Definition Language

Answer

Data Definition Language (DDL):- are the SQL statements that define the database structure.


Example:



  1.  CREATE

  2.  ALTER

  3.  DROP

  4.  TRUNCATE

  5.  COMMENT

  6.  RENAME

Report Error

View answer Workspace Report Error Discuss

1 1813
Q:

What is XPath?

Answer

XPath is an expressions to select a xml node in an XML document.


It allows the navigation on the XML document to the straight to the element where we need to reach and access the attributes.


 

Report Error

View answer Workspace Report Error Discuss

1 2062
Q:

What is the purpose of SQL Profiler in SQL server?

Answer

SQL profiler is a tool to monitor performance of various stored procedures. It is used to debug the queries and procedures. Based on performance, it identifies the slow executing queries. Capture any problems by capturing the events on production environment so that they can be solved.

Report Error

View answer Workspace Report Error Discuss

1 1871