O'Reilly logo

Learn Java for Android Development, Second Edition by Jeff Friesen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    3

Discovering Classes and Objects

In Chapter 2 I introduced you to the fundamentals of the Java language. You now know how to write simple applications by inserting statements into a class’s main() method. However, when you try to develop complex applications in this manner, you’re bound to find development tedious, slow, and prone to error. Classes and objects address these problems by simplifying application architecture.

In Chapter 3 I introduce you to Java’s support for classes and objects. You learn how to declare a class and instantiate objects from the class, how to declare fields within the class and access these fields, how to declare methods within the class and call them, how to initialize classes and objects, and how to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required