logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • public abstract interface Frobnicate { public void twiddle(String s); } Which is a correct class?


  • Options
  • 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) { } }

  • Correct Answer
  • public abstract class Frob implements Frobnicate { } 

    Explanation

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


  • Programming problems


    Search Results


    • 1. Macro flowchart is also called as

    • Options
    • A. Less Detail flowchart
    • B. More detail flowchart
    • C. Simple detailed flowchart
    • D. None of the above
    • Discuss
    • 2. How many times the following program would print 'Jamboree'? main() { printf ( "\nJamboree"); main (); }
    • Discuss
    • 3. Rewrite the following set of statements using conditional operators. int a =1, b ; if ( a > 10 ) b = 20;
    • Discuss
    • 4. Write a c program for linear search.
    • Discuss
    • 5. What will be output when you will execute following c code? #include void main() { switch(2) { case 1L:printf("No"); case 2L:printf("%s","I"); goto Love; case 3L:printf("Please"); case 4L:Love:printf("Hi"); } }

    • Options
    • A. I
    • B. IPleaseHi
    • C. IHi
    • D. Compilation error
    • Discuss
    • 6. Convert the expression ((A + B) * C ? (D ? E) ^ (F + G)) to equivalent Prefix Notation
    • Discuss
    • 7. What value does read() return when it has reached the end of a file?

    • Options
    • A. 1
    • B. -1
    • C. 0
    • D. None
    • Discuss
    • 8. What will be output of following program? #include int main() { void (*p)(); int (*q)(); int (*r)(); p = clrscr; q = getch; r = puts; (*p)(); (*r)("www.curioustab.com"); (*q)(); return 0; }

    • Options
    • A. NULL
    • B. www.curioustab.com
    • C. Compilation error
    • D. None of above
    • Discuss
    • 9. What would be the output of the following program? main() { char a[] = "Visual C++"; char *b = "Visual C++"; printf ("\n%d %d", sizeof (a), sizeof (b)); printf ("\n%d %d", sizeof (*a), sizeof (*b)); }
    • Discuss
    • 10. How would you find the length of each string in the following Program? main() { char *str[] = { "Frogs", "Do", "Not" , "Die" , "They" , "Croak!"}; printf ("%d%d", sizeof (str), sizeof (str[0])); }
    • Discuss


    Comments

    There are no comments.

Enter a new Comment