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

Condividi libro
  1. English
  2. ePUB (disponibile sull'app)
  3. Disponibile su iOS e Android
eBook - ePub

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

Exam 1Z0-808

Jeanne Boyarsky, Scott Selikoff

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide è disponibile online in formato PDF/ePub?
Sì, puoi accedere a OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide di Jeanne Boyarsky, Scott Selikoff in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatique e Programmation en Java. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Editore
Sybex
Anno
2014
ISBN
9781118957424
Edizione
1
Argomento
Informatique

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...

Indice dei contenuti