logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • Which of the following statement is true?


  • Options
  • 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

  • Correct Answer
  • 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


  • Programming problems


    Search Results


    • 1. What is the output of this C code? #include int main() { int a = 1, b = 1; switch (a) { case a*b: printf("yes "); case a-b: printf("non"); break; } }

    • Options
    • A. yes
    • B. no
    • C. Compile time error
    • D. yes no
    • Discuss
    • 2. SNOBOL is mainly used for

    • Options
    • A. Text Operation
    • B. String operations
    • C. List operations
    • D. Numerical operations
    • Discuss
    • 3. What will be output of the following c program ? #include int main() { int max-val=100; int min-val=10; int avg-val; avg-val =( max-val + min-val ) / 2; printf( "%d", avg-val ); return 0; }

    • Options
    • A. 55
    • B. 105
    • C. 60
    • D. Compilation error
    • Discuss
    • 4. A function cannot be defined inside another function

    • Options
    • A. TRUE
    • B. FALSE
    • Discuss
    • 5. What will be output when you will execute following c code? #include 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] ); }

    • Options
    • A. 2.000000
    • B. 4.000000
    • C. 8.000000
    • D. Compilation error
    • Discuss
    • 6. How many times i value is checked in the below code? #include int main() { int i = 0; do { i++; printf( "In while loopn" ); } while (i < 3); }

    • Options
    • A. 2
    • B. 3
    • C. 4
    • D. 1
    • Discuss
    • 7. void main() { char good *better, *best; printf( "%d..%d", sizeof(better), sizeof(best) ); }

    • Options
    • A. 1..2
    • B. 4..4
    • C. 4..2
    • D. 2..2
    • Discuss
    • 8. Output of the Program : main() { int i = 1; while (i <= 5) { printf( "%d", i ); if (i > 2) goto here; i++; } } fun() { here : printf( "PP" ); }

    • Options
    • A. 1
    • B. 2
    • C. Compilation error
    • D. Exception occurs
    • Discuss
    • 9. Which Of The Following Statements Is Most Accurate For The Declaration X = Circle()?

    • Options
    • A. x contains a reference to a Circle object
    • B. You can assign an int value to x
    • C. x contains an object of the Circle type
    • D. x contains an int value
    • Discuss
    • 10. What is the output of this C code? #include void main() { int y = 3; int x = 5 % 2 * 3 / 2; printf("Value of x is %d", x); }

    • Options
    • A. Value of x is 1
    • B. Value of x is 2
    • C. Value of x is 3
    • D. Compile time error
    • Discuss


    Comments

    There are no comments.

Enter a new Comment