Initialising large number of widgets in java class

My project has 40 buttons that I have to initialize them in my java class (I mean findViewById all the button in my java class). And then these buttons play a mediaPlayer and I have to use MediaPlayer class too (I mean MediaPlayer mp = MediaPlayer.create(this,R.id.sound)) and then I have to write setOnClickListener of each button.

It’s really hard and boring to all these works one by one. Is there any faster way to do all these things? I am new to android. Please help!

public class MainActivity extends AppCompatActivity {
    Button b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40;
    MediaPlayer mb1, mb2, mb3, mb4, mb5, mb6, mb7, mb8, mb9, mb10, mb11, mb12, mb13, mb14, mb15, mb16, mb17, mb18, mb19, mb20, mb21, mb22, mb23, mb24, mb25, mb26, mb27, mb28, mb29, mb30, mb31, mb32, mb33, mb34, mb35, mb36;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        b1 = (Button) findViewById(R.id.button1);
        b2 = (Button) findViewById(R.id.button2);
        b3 = (Button) findViewById(R.id.button3);
        b4 = (Button) findViewById(R.id.button4);
        b5 = (Button) findViewById(R.id.button5);
        b6 = (Button) findViewById(R.id.button6);
        b7 = (Button) findViewById(R.id.button7);
        b8 = (Button) findViewById(R.id.button8);
        b9 = (Button) findViewById(R.id.button9);
        b10 = (Button) findViewById(R.id.button10);
        b11 = (Button) findViewById(R.id.button11);
        b12 = (Button) findViewById(R.id.button12);
        b13 = (Button) findViewById(R.id.button13);
        b14 = (Button) findViewById(R.id.button14);
        b15 = (Button) findViewById(R.id.button15);
        b16 = (Button) findViewById(R.id.button16);
        b17 = (Button) findViewById(R.id.button17);
        b18 = (Button) findViewById(R.id.button18);
        b19 = (Button) findViewById(R.id.button19);
        b20 = (Button) findViewById(R.id.button20);
        b21 = (Button) findViewById(R.id.button21);
        b22 = (Button) findViewById(R.id.button22);
        b23 = (Button) findViewById(R.id.button23);
        b24 = (Button) findViewById(R.id.button24);
        b25 = (Button) findViewById(R.id.button25);
        b26 = (Button) findViewById(R.id.button26);
        b27 = (Button) findViewById(R.id.button27);
        b28 = (Button) findViewById(R.id.button28);
        b29 = (Button) findViewById(R.id.button29);
        b30 = (Button) findViewById(R.id.button30);
        b31 = (Button) findViewById(R.id.button31);
        b32 = (Button) findViewById(R.id.button32);
        b33 = (Button) findViewById(R.id.button33);
        b34 = (Button) findViewById(R.id.button34);
        b35 = (Button) findViewById(R.id.button35);
        b36 = (Button) findViewById(R.id.button36);
        b37 = (Button) findViewById(R.id.button37);
        b38 = (Button) findViewById(R.id.button38);
        b39 = (Button) findViewById(R.id.button39);
        b40 = (Button) findViewById(R.id.button40);
        mb1 = MediaPlayer.create(this, R.raw.ability);
        mb2 = MediaPlayer.create(this, R.raw.applause);
        mb3 = MediaPlayer.create(this, R.raw.appointment);
        mb4 = MediaPlayer.create(this, R.raw.atthemoment);
        mb5 = MediaPlayer.create(this, R.raw.audience);
        mb6 = MediaPlayer.create(this, R.raw.depression);
        mb7 = MediaPlayer.create(this, R.raw.disaster);
        mb8 = MediaPlayer.create(this, R.raw.dizzy);
        mb9 = MediaPlayer.create(this, R.raw.educated);
        mb10 = MediaPlayer.create(this, R.raw.emotion);
        mb11 = MediaPlayer.create(this, R.raw.entertain);
        mb12 = MediaPlayer.create(this, R.raw.experience);
        mb13 = MediaPlayer.create(this, R.raw.focus);
        mb14 = MediaPlayer.create(this, R.raw.however);
        mb15 = MediaPlayer.create(this, R.raw.humor);
        mb16 = MediaPlayer.create(this, R.raw.impress);
        mb17 = MediaPlayer.create(this, R.raw.inspire);
        mb18 = MediaPlayer.create(this, R.raw.instruct);
        mb19 = MediaPlayer.create(this, R.raw.massage);
        mb20 = MediaPlayer.create(this, R.raw.medication);
        mb21 = MediaPlayer.create(this, R.raw.mental);
        mb22 = MediaPlayer.create(this, R.raw.offer);
        mb23 = MediaPlayer.create(this, R.raw.painkiller);
        mb24 = MediaPlayer.create(this, R.raw.permission);
        mb25 = MediaPlayer.create(this, R.raw.physician);
        mb26 = MediaPlayer.create(this, R.raw.possible);
        mb27 = MediaPlayer.create(this, R.raw.present);
        mb28 = MediaPlayer.create(this, R.raw.psychologist);
        mb29 = MediaPlayer.create(this, R.raw.resemble);
        mb30 = MediaPlayer.create(this, R.raw.sincerely);
        mb31 = MediaPlayer.create(this, R.raw.specialist);
        mb32 = MediaPlayer.create(this, R.raw.speech);
        mb33 = MediaPlayer.create(this, R.raw.splittingheadache);
        mb34 = MediaPlayer.create(this, R.raw.sprain);
        mb35 = MediaPlayer.create(this, R.raw.touch);
        mb36 = MediaPlayer.create(this, R.raw.treat);

Use Recyclerview or ListView to show list of button

You should do something like this, for example, for the button:

Button[] button=new Button[40];

for(i=0;i<40;i++){
   String buttonName="button"+(i+1);
   int buttonId=getResources().getIdentifier(buttonName,"id",mContext.getPackageName());
   button[i] = (Button) findViewById(buttonId);
}