CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    45

    A tricky practice test question (for me)

    My teacher gave us a practice test and I would just like to know why the answer is (b) to the following question:

    Any new class you create from an existing class is called a(n)

    (a) base class (b) derived class (c) superclass (d) extended class.
    I had chosen (d) but I knew it had to be between (b) and (d). I would appreciate it if someone could explain this in a bit more detail so that I can understand the answer rather than just memorize it.

    Any input would be greatly appreciated!
    Thanks in advance!

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: A tricky practice test question (for me)

    a, c, and d are synonymous, although d is semantically ambiguous to many people. An 'extended' class is, strictly, a class that has been extended, so if class A is extended to make class B, class A is the extended class, and class B the extension. However, you could also claim that class B is an extended form of class A, so class B could be called the extended class - this is a type of grammatical confusion that seems increasingly common.

    A derived class is a class is derivative; it is based on another class, it extends another class, it is a subclass.

    When a programming language is created that allows programmers to program in simple English, it will be discovered that programmers cannot speak English...
    Anon.
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  3. #3
    Join Date
    May 2009
    Posts
    2,413

    Re: A tricky practice test question (for me)

    Quote Originally Posted by s3a View Post
    I had chosen (d) but I knew it had to be between (b) and (d). I would appreciate it if someone could explain this in a bit more detail so that I can understand the answer rather than just memorize it.
    The Java terminology is pretty clear (as established in the Java Programming Language by Gosling and others).

    The base class/derived class pair is avoided (it's C++ terminology). Instead the superclass/subclass pair is preferred. Furthermore, an extended class is a subclass.

    So in a strict Java sense the correct answer is (d). In a wider sense (b) is also correct.

  4. #4
    Join Date
    Mar 2010
    Posts
    74

    Re: A tricky practice test question (for me)

    This is a kind of questions from eggheads :-)
    How answer to this question will help to create perfect code?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured