Ask Question
31 May, 04:46

Some classes, like the ArrayList class, use angle brackets in their documentation and their declaration. For example, the Java documentation for the ArrayList class starts with this: public class ArrayList. What is the name for classes that have extra "parameter (s) " in angle brackets like this? Group of answer choices generic classes specific classes hard classes type classes

+2
Answers (1)
  1. 31 May, 05:08
    0
    The answer to the following question is Generic classes.

    Explanation:

    The declaration of the generic classes is the same as the declaration of non-generic classes but except the class name has followed by the type of parameter section.

    The parameter section of the generic class can have only one or more than one type parameter which is separated by the commas.

    Following example can explain that how can define generic class.

    public class demo {

    private D d;

    public void fun (D d) {

    this. d = d;

    }

    public D get () {

    return d;

    }

    public static void main (String[] args) {

    demo integerdemo = new demo ();

    demo stringdemo = new demo ();

    integerdemo. fun (new Integer (10));

    stringdemo. fun (new String ("Hello World"));

    System. out. printf ("The Integer Value is : %d/n/n", integerdemo. get ());

    System. out. printf ("The String Value is : %s/n", stringdemo. get ());

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Some classes, like the ArrayList class, use angle brackets in their documentation and their declaration. For example, the Java ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers