Need to declare the variables

As you have shown in the vidoe that we don’t need to declare views using findViewById . But when I am using the attribute of the views without declaring it , it’s showing the error.