Skip to content

Commit 1e68d94

Browse files
Update README.md
1 parent b240a7c commit 1e68d94

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5342,6 +5342,47 @@ List<Number> --> b2<Double>
53425342

53435343
</ul>
53445344

5345+
<h2><li>3. Generic Anonymous Class </li></h2>
5346+
5347+
<ul>
5348+
5349+
<h3><i><ins>Generic Anonymous Class:</ins></i> Like Anonymous CLass as those classes are nested class which have no name , hence Anonymous.Whatever the class returns stored in a variable created through that Class i.e. object of that class.As they are nested inside a class , also known as <i><ins> Anonymous Inner Class </ins></i>.As they can be <i>Parameterized</i>, hence <i><ins>Generic Anonymous Class</ins></i>.</h3>
5350+
5351+
<h3 align="Left">
5352+
5353+
```
5354+
++++++++
5355+
+Eg: 1 +
5356+
++++++++
5357+
5358+
interface A<T> {
5359+
T get(T t);
5360+
}
5361+
5362+
5363+
public class Example {
5364+
//Anynomous Generic Class
5365+
A<String> a = new A<String>() {
5366+
@Override
5367+
public String get(String s) {
5368+
System.out.println(s);
5369+
return s;
5370+
}
5371+
};
5372+
public static void main(String[] args) {
5373+
Example e = new Example();
5374+
e.a.get("Hello");
5375+
}
5376+
5377+
5378+
}
5379+
5380+
```
5381+
5382+
5383+
</h3>
5384+
5385+
</ul>
53455386

53465387
</ul>
53475388

0 commit comments

Comments
 (0)