![ my firebase-realtime-database image](https://i.stack.imgur.com/iwvwt.png)

I've been stuck for two days on this previous segment (Java and Firebase).

I kept a class-type list in the database but when I try to get it to Firebase I get an error.

This is the code:

```
ArrayList<PostDetails_class> cPostList=new ArrayList<PostDetails_class>();
FirebaseDatabase.getInstance().getReference().addValueEventListener( new ValueEventListener() {
          @Override
          public void onDataChange(@NonNull DataSnapshot snapshot) {
              cPostList= (ArrayList<PostDetails_class>) snapshot.child( "application_details" ).child( "community_postsList" ).getValue();
          }
          @Override
          public void onCancelled(@NonNull DatabaseError error) {

          }
      } );

```

This is an attempt to read data from the "cPost\_List" list which is a list built from the "PostDetails\_class" class.
("community\_postsList" is a child that is a list of the "PostDetails\_class" class):

```
PostDetails_class postDetails_class=cPostList.get( 0 );  //line 123 in main activity

```

the error:

```
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.myapp, PID: 1938
    java.lang.ClassCastException: java.util.HashMap cannot be cast to com.example.myapp.PostDetails_class
        at com.example.myapp.MainActivity.makeList(MainActivity.java:123)

```