The Java Program, User.java


In order to store a user profile, we need a model class called User.java, which includes the properties: name and email address (you can add few more properties like address, phone number, etc.).
import com.google.firebase.database.IgnoreExtraProperties;
Properties that do not map to class fields are ignored when serializing to a class annotated with this annotation.

@IgnoreExtraProperties
The @ symbol denotes a Java annotation, which adds a special attribute to the variable, method, class, interface, or other language elements.
MyFirebase\app\java\com\wenchen\myfriebase\User.java
 package com.wenchen.myfirebase
 import com.google.firebase.database.IgnoreExtraProperties;

 @IgnoreExtraProperties
 public class User {
   public String name;
   public String email;

   // Default constructor required for calls to DataSnapshot.getValue( User.class )
   public User( ) { }

   public User( String name, String email ) {
     this.name  = name;
     this.email = email;
   }
 }




      When I found out Tom crashed my car,    
      I hit the roof (become very angry).