Technical Questions

Q:

public abstract interface Frobnicate { public void twiddle(String s); } 

Which is a correct class?

A) public abstract class Frob implements Frobnicate { public abstract void twiddle(String s) { } } B) public abstract class Frob implements Frobnicate { }
C) public class Frob extends Frobnicate { public void twiddle(Integer i) { } } D) public class Frob implements Frobnicate { public void twiddle(Integer i) { } }
 
Answer & Explanation Answer: B) public abstract class Frob implements Frobnicate { }

Explanation:

B is correct, an abstract class need not implement any or all of an interface’s methods

Report Error

View Answer Report Error Discuss

Filed Under: Programming

2 15672
Q:

How many times i value is checked in the below code?

       #include <stdio.h>
        int main()
        {
            int i = 0;
            do {
                i++;
                printf( "In while loopn" );
            } while (i < 3);
        }

A) 2 B) 3
C) 4 D) 1
 
Answer & Explanation Answer: B) 3

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Programming

5 15205
Q:

Unreachable code would best be found using

A) code inspections B) a static analysis tool
C) code reviews D) a test management tool
 
Answer & Explanation Answer: C) code reviews

Explanation:

Code review is a software quality assurance activity in which one or several humans check a program mainly by viewing and reading parts of its source code, and they do so after implementation or as an interruption of implementation.

Report Error

View Answer Report Error Discuss

14 15155
Q:

What will be output when you will execute following c code?

#include <stdio.h>
void main()

{
    int const SIZE = 5;
    int expr;
    double value[SIZE] = { 2.0, 4.0, 6.0, 8.0, 10.0 };
    expr=1|2|3|4;
    printf ( "%f", value[expr] );
}

A) 2.000000 B) 4.000000
C) 8.000000 D) Compilation error
 
Answer & Explanation Answer: D) Compilation error

Explanation:

Size of any array in c cannot be constantan variable.

Report Error

View Answer Report Error Discuss

Filed Under: Programming

5 15030
Q:

Physical or logical arrangement of network is

A) Topology B) Routing
C) Both A & B D) Networking
 
Answer & Explanation Answer: A) Topology

Explanation:

The logical arrangement of the nodes of different networks to communicate is called as topology.

Report Error

View Answer Report Error Discuss

23 14781
Q:

Statement coverage will not check for the following

A) Dead Code B) Unused Statement
C) Missing Statements D) Unused Branches
 
Answer & Explanation Answer: C) Missing Statements

Explanation:

Statement coverage is a white box test design technique which involves execution of all the executable statements in the source code at least once. It is used to calculate and measure the number of statements in the source code which can be executed given the requirements.

Report Error

View Answer Report Error Discuss

7 14751
Q:

Which of the following statement is true?

A) Cohesion is the OO principle most closely associated with hiding implementation details B) Cohesion is the OO principle most closely associated with making sure that classes know about other classes only through their APIs
C) Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose D) None
 
Answer & Explanation Answer: C) Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose

Explanation:

A refers to encapsulation, B refers to coupling

Report Error

View Answer Report Error Discuss

Filed Under: Programming

4 14396
Q:

What is a binary semaphore? What is its use?

Answer

A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes.

Report Error

View answer Workspace Report Error Discuss

9 14317