Understanding & lt; & gt;

I am looking for this site . I do not understand what it means:

private ArrayList<HashMap<String, String>> data; 

Please explain this to me.

thanks

+4
source share
3 answers

These are the html objects:

 &lt; -> < &gt; -> > 

These characters must be escaped in html because they are used to start and end html tags:

 <p>, <b>, etc. 

So the line you were asking about with replaceable html objects:

 Private ArrayList<HashMap<String, String>> data; 

These html objects were left in the code snippet on the site you specified, most likely by mistake or due to an error in how this site avoids the code snippets.

+13
source

This is an HTML-encoded blog post error,

  • &lt; = < (less)
  • &gt; = > (Greaterthan)

The code really should look like private ArrayList<HashMap<String, String>> data;

You should be able to decode such HTML code from here (htmlspecialchars_decode).

+1
source

These are common patterns that Java also supports. Think that without Generics you can declare a thing like this.

It could be like this:

 HashMap table = new HashMap(); ArrayList arr = new ArrayList(); arr.Add(table); 

Using Generics, instead of working with objects and casting or transforming (late restriction), you can write as simple as possible. As you mentioned:

 private ArrayList<HashMap<String, String>> data; 

and so it’s easier to work with the declared variable.

Greetings

0
source

Source: https://habr.com/ru/post/1433107/


All Articles