OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide
eBook - ePub

OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide

Exam 1Z0-808

Jeanne Boyarsky, Scott Selikoff

Buch teilen
  1. English
  2. ePUB (handyfreundlich)
  3. Über iOS und Android verfügbar
eBook - ePub

OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide

Exam 1Z0-808

Jeanne Boyarsky, Scott Selikoff

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide von Jeanne Boyarsky, Scott Selikoff im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatique & Programmation en Java. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Verlag
Sybex
Jahr
2014
ISBN
9781118957424

Chapter 1
Java Building Blocks

OCA exam objectives covered in this chapter:

  • correct
    Java Basics
    • 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.
  • correct
    Working with Java Data Types
    • 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
Welcome to the beginning of your journey to become certified on Java. We assume this isn't the first Java programming book you've read. Although we do talk about the basics, we do so only because we want to make sure you have all the terminology and detail you'll need for the OCA exam. If you've never written a Java program before, we recommend you pick up an introductory book on any version of Java—something like Head First Java, 2nd Edition (O'Reilly Media, 2005); Java for Dummies (For Dummies, 2014), or Thinking in Java, 4th Edition (Prentice Hall, 2006). (It's okay if the book covers an older version of Java—even Java 1.3 is fine.) Then come back to this certification study guide.
This chapter covers the fundamentals of Java. You'll see how to define and run a Java class, and learn about packages, variables, and the object life cycle.

Understanding the Java Class Structure

In Java programs, classes are the basic building blocks. When defining a class, you describe all the parts and characteristics of one of those building blocks. To use most classes, you have to create objects. An object is a runtime instance of a class in memory. All the various objects of all the different classes represent the state of your program.
In the following sections, we'll look at fields, methods, and comments. We'll also explore the relationship between classes and files.

Fields and Methods

Java classes have two primary elements: methods, often called functions or procedures in other languages, and fields, more generally known as variables. Together these are called the members of the class. Variables hold the state of the program, and methods operate on that state. If the change is important to remember, a variable stores that change. That's all classes really do. It's the programmer who creates and arranges these elements in such a way that the resulting code is useful and, ideally, easy for other programmers to understand.
Other building blocks include interfaces, which you'll learn about in Chapter 5, “Class Design,” and enums, which you'll learn about when you start studying for the OCP exam.
The simplest Java class you can write looks like this:
1: public class Animal { 2: }
Java calls a word with special meaning a keyword. The 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: }
image

The line numbers aren't part of the program; they're just there to make the code easier to talk about.
On line 2, we define a variable named 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: }
On lines 3–5, you've defined your first method. A method is an operation that can be called. Again, public is used to signify that this method may be called from other classes. Next comes the return type—in this case, t...

Inhaltsverzeichnis