6
Q:

What is the output after compile and run the following code ?

int Output = 10;
boolean b = false;
if((b == true) && ((Output += 10) == 20))
{
System.out.println("We are equal " + Output);
}
else
{
System.out.println("Not equal! " + Output);
}

A) Compilation and output of "We are equal 10" B) Compilation and output of "Not equal! 10"
C) Compilation error, attempting to perform binary comparison on logical data type D) Compilation and output of "Not equal! 20"

Answer:   B) Compilation and output of "Not equal! 10"



Explanation:

The output will be "Not equal! 10". Please note that && is logical AND operator. If first operand before (&&) is false then the other operand will not be evaluated. This illustrates that the Output +=10 calculation was never performed because processing stopped after the first operand was evaluated to be false. If you change the value of b1 to true, processing occurs as you would expect and the output would be "We are equal 20".

Subject: Oracle Certification
Job Role: Analyst
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 3097
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 1946
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 1824
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 2066
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 1877