-2

enter image description here Can someone fix it? Can someone tells me that why the compiler doesn't allow me to do that? I watch this from online tutorial.

Ranjith Kumar
  • 13,385
  • 9
  • 95
  • 126
Josiah Wu
  • 65
  • 11

1 Answers1

0

It's Object not Objects, but it's recommended to make it the specific data type you want to input in your map(Integer in your case) and this way you can make use of compile time checking of data types instead of doing that in run time. For example, you can't make it an Integer and input anything in it except Integers.

Ahmed Hegazy
  • 11,465
  • 5
  • 35
  • 62