title: Why is "String.class" necessary here?
body: <p>Given this code:</p>
  
  <pre><code>dm.addChildEventListener(new ChildEventListener() {
      @Override
      public void onChildAdded(@NonNull DataSnapshot dataSnapshot, 
      @Nullable String s) {
          String value = dataSnapshot.getValue(String.class);
          arrayList.add(value);
          adapter.notifyDataSetChanged();
      }
  }
  </code></pre>
  
  <p>I don't understand why we use <code>String.class</code> in the method</p>
  
  <pre><code> dataSnapshot.getValue(String.class); 
  </code></pre>
  
  <p>What is the purpose of it? I am using it when getting data from Firebase. My code is working fine. Just want to learn the meaning.</p>