OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide
Exam 1Z0-808
Jeanne Boyarsky, Scott Selikoff
- English
- ePUB (mobile friendly)
- Available on iOS & Android
OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide
Exam 1Z0-808
Jeanne Boyarsky, Scott Selikoff
About This Book
Full coverage of functional programming and all OCA Java Programmer exam objectives
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.
- Work confidently with operators, conditionals, and loops
- Understand object-oriented design principles and patterns
- Master functional programming fundamentals
Frequently asked questions
Information
Chapter 1
Java Building Blocks
OCA exam objectives covered in this chapter:
- Define the scope of variables
- Define the structure of a Java class
- Create executable Java applications with a main method; run a Java program from the command line; including console output
- Import other Java packages to make them accessible in your code
- Compare and contrast the features and components of Java such as platform independence, object orientation, encapsulation, etc.
- Declare and initialize variables (including casting or primitive types)
- Differentiate between object reference variables and primitive variables
- Know how to read or write to object fields
- Explain an Object's Lifecycle (creation, âdereference by reassignmentâ and garbage collection
Understanding the Java Class Structure
Fields and Methods
1: public class Animal { 2: }
public
keyword on line 1 means the class can be used by other classes. The class
keyword indicates you're defining a class. Animal
gives the name of the class. Granted, this isn't a very interesting class, so add your first field:1: public class Animal { 2: String name; 3: }
The line numbers aren't part of the program; they're just there to make the code easier to talk about.
name
. We also define the type of that variable to be a String
. A String
is a value that we can put text into, such as "this is a string "
. String
is also a class supplied with Java. Next you can add methods:1: public class Animal { 2: String name; 3: public String getName() { 4: return name; 5: } 6: public void setName(String newName) { 7: name = newName; 8: } 9: }
public
is used to signify that this method may be called from other classes. Next comes the return typeâin this case, t...