Ask Question

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

+4
Answers (1)
  1. 11 July, 08:05
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers