How to Instantiate a new Button, in Java

Button was added in API Level 1

1. Declare a Button named myButton.

2. After you declare the Button object, add this line below to instantiate it. This will instantiate a new Button  named myButton.

myButton = new Button(this);

3. Compile and run!