-1

Some exapmle

JsonArrayRequest req = new JsonArrayRequest(...) {
   @Override
   protected Response<JSONArray> parseNetworkResponse(NetworkResponse response) {
   .....
 }
}

I don't know how it works. I am bit confused in this plase

JsonArrayRequest(...) {here}

First we call constructor then somehow override the method.

ps: sorry for the stupid question, I'm a Python Developer :)

Tany
  • 393
  • 1
  • 4
  • 16

1 Answers1

1

It's called an anonymous class. Anonymous classes are implementations of Interfaces or abstract classes that could otherwise not be instantiated. You can take a closer look at the documentation by Oracle: https://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html

hotzst
  • 7,238
  • 9
  • 41
  • 64