I'm going to expand on the other answers a bit (which are correct), but fail to mention a powerful shortcut that Android Studio exposes to you which allows you to easily do this without typing.
Highlight the line in question
String memberID = newMyClass.executeHttpGet("http://www.mysite.com");
Use the keyboard shortcut Ctrl+Alt+T on PC, ⌘+⌥+J on Mac
Choose try / catch
, try / finally
, or try / catch / finally
depending on your needs.
The result will be the following, without typing any code at all. It makes you much more efficient and you will begin to enjoy Android Studio and become a more powerful
try {
String memberID = newMyClass.executeHttpGet("http://www.mysite.com");
} catch (Exception e) {
e.printStackTrace();
}
You're going to need to re-scope the String of course.