What is the difference between these three Buttons

```
Button button = (Button)

```

I mean to say what is 1st button and what is 2nd button and also what is 3rd button? I cant find the explanation on the internet, every one in the video lecture uses these three "button", **I am totally confused** with these buttons. And also

```
Button button = (Button) findViewById(R.id.button)

```

Why are they using `R`? Could someone just give me explanation on this line of code to better understand? please help me, **Thanks in Advance**

[![enter image description here](https://i.stack.imgur.com/Mhfhj.png)](https://i.stack.imgur.com/Mhfhj.png)