Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808
  • Table Of Contents Toc
OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808

OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808

By : Jeanne Boyarsky, Scott Selikoff
close
close
OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808

OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808

By: Jeanne Boyarsky, Scott Selikoff

Overview of this book

OCA, Oracle Certified Associate Java SE 8 Programmer I Study Guide, Exam 1Z0-808 is a comprehensive study guide for those taking the Oracle Certified Associate Java SE 8 Programmer I exam (1Z0-808). With complete coverage of 100% of the exam objectives, this book provides everything you need to know to confidently take the exam. The release of Java 8 brought the language’s biggest changes to date, and for the first time, candidates are required to learn functional programming to pass the exam. This study guide has you covered, with thorough functional programming explanation and information on all key topic areas Java programmers need to know. You’ll cover Java inside and out and learn how to apply it efficiently and effectively to create solutions applicable to real-world scenarios.
Table of Contents (18 chapters)
close
close
Lock Free Chapter
1
Title Page
2
Copyright
3
Publisher's Note
4
Dedication
5
Acknowledgments
6
About the Authors
15
Free Online Learning Environment
16
End User License Agreement

Creating Constructors

As you learned in Chapter 1, a constructor is a special method that matches the name of the class and has no return type. Here's an example:

public class Bunny {
  public Bunny() {
    System.out.println("constructor");
  }
}

The name of the constructor, Bunny, matches the name of the class, Bunny, and there is no return type, not even void. That makes this a constructor. Can you tell why these two are not valid constructors for the Bunny class?

public bunny() { }     // DOES NOT COMPILE
public void Bunny() { }

The first one doesn't match the classname because Java is case sensitive. Since it doesn't match, Java knows it can't be a constructor and is supposed to be a regular method. However, it is missing the return type and doesn't compile. The second method is a perfectly good method, but is not a constructor because it has a return type.

Constructors are used when creating a new object. This process is called instantiation because...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon