Technology Questions

Q:

Give an example for the use of volatile keyword in c++ ?

Answer

Most of the times compilers will do optimization to the code to speed up the program. For example in the below code,


int k = 15;
while( k == 15)


{
// Do something
}


compiler may think that value of 'k' is not getting changed in the program and replace it with 'while(true)', which will result in an infinite loop. In actual scenario, the value of 'k' may be getting updated from outside of the program.


Volatile keyword is used to tell compiler that the variable declared using 'volatile' may be used from outside the current scope, so that compiler won't apply any optimization. This matters only in case of multi-threaded applications.


In the above example if variable 'k' was declared using volatile, compiler will not optimize it. In shot, value of the volatile variables will be read from the memory location directly.

Report Error

View answer Workspace Report Error Discuss

5 5391
Q:

What is the function of the CICS translator?

Answer

The CICS translator converts the EXEC CICS commands into call statements for a specific programming language. There are CICS translators for Assembler, COBOL, and PL/1.

Report Error

View answer Workspace Report Error Discuss

0 5378
Q:

$message vs $$message in PHP?

Answer

$message is a variable with a fixed name. $$message is a variable whose name is stored in $message. 


If $message contains "var", $$message is the same as $var.


 

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 5323
Q:

Values that are used to end loops are referred to as _____ values.

A) stop B) sentinel
C) end D) finish
 
Answer & Explanation Answer: B) sentinel

Explanation:
Report Error

View Answer Report Error Discuss

4 5322
Q:

What is dynamic method dispatch?

Answer

Dynamic method dispatch which is also known as runtime polymorphism is a process in which a call to an overridden method is resolved at runtime rather than at compile-time. In this process, an overridden method is called through the reference variable of a superclass. The determination of the method to be called is based on the object being referred to by the reference variable.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 5310
Q:

What is Mainframe Testing?

Answer

Mainframe Testing is similar to client-server applications testing, but you have to know how to operate basic TSO and ISPF commands and menus, view mainframe files, look at and use SDSF or other output tool, log on CICS and transactions, use FTP or another transfer protocol, submit the batch job - it's for QA testing of mainframe applications.

Report Error

View answer Workspace Report Error Discuss

0 5305
Q:

How variable declaration in c++ differs that in c?

Answer

C requires all the variables to be declared at the beginning of a scope but in c++ we can declare variables anywhere in the scope. This makes the programmer easier to understand because the variables are declared in the context of their use.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

1 5302
Q:

Which among the following is a scope resolution operator?

A) : B) ::
C) :? D) None
 
Answer & Explanation Answer: B) ::

Explanation:

:: is the scope resolution operator

Report Error

View Answer Report Error Discuss

Filed Under: Java
Job Role: Software Architect

0 5301