Ocp java se 8 programmer exam guide pdf download






















The author shall not be liable for damages arising herefrom. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. All other trademarks are the property of their respective owners. The Author is not associated with any product or vendor mentioned in this book.

Saturday 12th October, Build 1. Thank you to Carol Davis and Robert Nyquist for technical proof reading. Thank you to Aakash Jangid and Bill Bruening for validating all the code snippets in this book. Thank you to Maaike Van Putten for her inputs on the book cover design and to Kino Lockhart for designing the cover.

Their experience helped fine tune several topics in this book. I am also thankful to countless Enthuware. Finally, I am also thankful for the following readers for their help in improving the content of this book through suggestions and by reporting errors: 1. Zheng-Yu Wang 2. Hanumant specializes in Java based multi-tier applications in financial domain.

He has executed projects for some of the top financial companies. He started Enthuware. After spending more than a decade working with amazing people in the United States, he returned back to India to pursue a degree in Law. He is a big believer in freedom of speech and expression and works on promoting it in his spare time. You may reach him at support enthuware. First of all, let me commend your decision to consider Java certification as a step towards achieving that goal.

Irrespective of whether you get extra credit for being certified in your job hunt or not, you will be able to speak with confidence in technical interviews and the concepts that this certification will make you learn, will improve your performance on the job.

This exam focuses on the fundamental aspects of Java and is not particularly tough to pass. If you go through a decent book and practice a few good mock exams, you should be able to pass it with a couple of months of preparation. However, the topics covered in this certification form the groundwork for the second step of professional certification, i.

You will have trouble passing that exam if your fundamentals are weak. About the mock exams Mock exams are an essential preparation tool for achieving a good score on the exam.

However, having created mock exams for several certifications, I can tell you that creating good quality questions is neither easy nor quick. Even after multiple reviews and quality checks, it takes years of use by thousands of users for the questions to shed all ambiguity, errors, and mistakes. I have seen users come up with plausible interpretations of a problem statement that we could never imagine.

A bad quality mock exam will easily eat up your valuable time and may also shake your confidence. For this reason, I have not created new mock exams for this book.

Introduction team from our website Enthuware. It is priced quite reasonably only 9. This book is for Java SE 11 Programmer - I exam 1Z takers who know how to program and are at least aware of the basic Java terminology. Before proceeding with this study guide, please answer the following questions.

The intention here is to check if you are at least familiar with the basic concepts. I will go through all that in this book, but I will not teach the basics of programming in this book. Do you know what a command line is? Can you write a simple Hello World program in Java and run it from the command line? Do you know what variables are? Do you know what loops such as for loop and while loop are and what they are used for? Are you aware of arrays? Are you aware that Java has classes and interfaces?

Are you aware that classes and interfaces have methods? Have you installed JDK 11 on your computer? If you answered no to any of the above, this book is not for you. It would be better if you go through a programming book or a computer book for beginners first, and then come back to this book.

Alternatively, be open to google a term if you are not sure about it at any time before proceeding further while reading this book. With so many certification books around, I think this question is worth answering at the outset. This book is fundamentally different from others in the following respects: 1. Focus on concepts - I believe that if you get your basic concepts right, everything else falls in place nicely. While working with Java beginners, I noticed several misconceptions, misunderstandings, and bad short cuts that would affect their learning of complex topics later.

I have seen so many people who manage to pass the exam but fail in technical interviews because of this reason. In this book, I explain the important stuff from different perspectives. This does increase the length of the book a bit but the increase should be well worth your time. Introduction 2. No surgical cuts - Some books try to stick very close to the exam objectives.

So close that sometimes a topic remains nowhere close to reality and the reader is left with imprecise and, at times, incorrect knowledge. This strategy is good for answering multiple choice questions appearing on the OCPJP-I exam but it bites the reader during technical interviews and while writing code on the job. I believe that answering multiple choice questions MCQs should not be your sole objective. Learning the concepts correctly is equally important.

For this reason, I go beyond the scope of exam objectives as, and when, required. Of course, I mention it clearly while doing so. While it seems quite an easy task for experienced programmers, I have observed that beginners are often clueless about what exactly they should be writing.

When they are not sure about what exactly a test program should do, they skip this important learning step altogether. In my training sessions, I give code writing exercises with clear objectives. I have done the same in this book. Instead of presenting MCQs or quizzes at the end of a topic or chapter, I ask you to write code that uses the concepts taught in that topic or chapter.

Besides, a question in the real exam generally requires knowledge of multiple topics. Thus, presenting an MCQ at the end of a topic, that focuses only on that one topic, creates a false sense of confidence. I believe it is better to focus on realistic MCQs at the end of your preparation. You already know what to expect in an exam. It closely mimics the user interface of the real exam. This book consists of seventeen chapters plus this introduction at the beginning.

The sections of a chapter also correspond directly to the items of exam objectives in most cases. Each chapter lists the exam objectives covered in that chapter at the beginning and includes a set of coding exercises at the end. It would be best to read the book sequentially because each chapter incrementally builds on the concepts discussed in the previous chapters. I have included simple coding exercises throughout the book. Try to do them. If you have already had a few years of Java development experience, you may go through the chapters in any order.

Conventions used in this book This book uses certain typographic styles in order to help you quickly identify important informa- tion. These styles are as follows: Code font - This font is used to differentiate between regular text and Java code appearing within regular text. Code snippets containing multiple lines of code are formatted as Java code within rectangular blocks.

It could be because of incorrect syntax or some other error. Output code font - This font is used to show the output generated by a piece of code on the command line. Bold font - I have highlighted important words, terms, and phrases using bold font to help you mentally bookmark them. If you are cruising through the book, the words in bold will keep you oriented besides making sure you are not missing anything important.

Note - Note Things that are not completely related to the topic at hand are explained in notes. I have used notes to provide additional information that you may find useful on the job or for technical interviews but will most likely not be required for the exam. Exam Tip: Exam Tip Exam Tips contain points that you should pay special attention to during the exam.

I have also used them to make you aware of the tricks and traps that you will encounter in the exam. If you are reading this book on an electronic device, you will see this icon beside every topic title.

Clicking on this icon will take you to an existing discussion on that particular topic in the same forum. If the existing discussion addresses your question, great! You will have saved time and effort. We use the same mechanism for addressing concerns about our mock exam questions and have received tremendous appreciation from the users about this feature.

Introduction 0. While going through this book, you will be tempted to ask this question many times. Let me answer this question at the beginning itself. I do talk about concepts in this book that are not explicitly listed in the official exam objectives but wherever I deviate from the official exam objectives, I clearly specify so.

You are free to ignore that section and move on. But I suggest you do not skip such sections because of the following reasons. While discussing a rule of the language, I may have to refer to some terms and concepts for the sake of completeness and technical accuracy. If I state that you cannot have more than one public class in a file, it is fine for the purpose of the exam but it is technically incorrect because you can have any number of public nested classes in a file.

Thus, it would be better to state that you cannot have more than one top-level class in a file. How about one public top-level class and one public interface? Thus, the statement is still incorrect. The correct statement would be that you cannot have more than one public top-level reference type in a file. If you absolutely do not want to spend any time learning about anything that is not part of the exam, then this book is not for you.

I have tried to stick to the objectives as much as possible but, if I believe you need to know something, I talk about it even if it is beyond the scope of the exam. I have noticed that many of the certification aspirants are new Java programmers who are either in school or want to start their career with Java programming.

They want to get certified because they ultimately want to land a job as a Java programmer. These programmers will be facing a lot of technical interviews as well. I want these programmers to do well on technical interviews.

Certification may get you a foot in the door but you will need to back it up with strong knowledge of fundamentals in the interview. Therefore, if I believe that something is important for you to know or that something will be helpful to you in your technical interview, irrespective of whether it will be asked in the exam or not, I discuss it. Official exam objectives are neither detailed nor exhaustive. They list top level topics that you need to study but leave out finer details.

You will be asked questions that require you to know those concepts. Oracle adds new questions to the exam before formally adding a new topic in the official exam objectives. These questions may not be included in your final score, i. However, test takers do not know if a question is unscored and so, they must attempt it as if it will be counted towards their final score. Since we, at Enthuware, conduct classroom training as well, we get to interact with a lot of test takers.

After receiving such multiple reports, we may decide to add that topic to our content. We clearly specify the reason for their inclusion. Official exam objectives are not constant. Although not frequently, Oracle does add and remove topics from the objectives from time to time.

This may render some of the content not relevant for the exam. I will update the content as soon as possible. If you are interested in getting your basics right, then I suggest you do not worry too much about the exam objectives while following this book.

Code Formatting - You may not find nicely formatted code in the exam. But it may also happen inadvertently due to variations in display screen size and resolution. For example, what will the following code print? You have to assume that this code appears in a valid context such as within a method of a class.

Introduction need to assume that appropriate import statements are in place. You should not fret over the missing stuff. Just focus on the code that is given and assume that everything else is irrelevant and is not required to arrive at the answer. Tricky Code - You will see really weird looking code in the exam. Code that you may never even see in real life. You will feel as if the exam is about puzzles rather than Java programming. To some extent, that is correct.

If you have decided to go through the certification, there is no point in questioning the relevance. If you feel frustrated, I understand. Please feel free to vent out your anger on our forum and get back to work!

Number of correct options - Every question in the exam will tell you exactly how many options you have to select to answer that question correctly. Remember that there is no negative marking. In other words, marks will not be deducted for answering a question incorrectly.

Therefore, do not leave a question unanswered. There is a slight chance that you will have picked the correct answer. Eliminate wrong options - Even better than not leaving a question unanswered is make intelligent guesses by eliminating obviously incorrect options. You may see options that are contradictory to each other. This makes it a bit easy to narrow down the correct options. Hope this book helps you become a better Java programmer besides getting you the certification.

As mentioned before, Oracle may change these details at any time. They have done it in the past. Several times. Describe Java Technology and the Java development environment 2. Declare and initialize variables including casting and promoting primitive data types 2. Identify the scope of variables 3. Use local variable type inference 4. Create and manipulate Strings 5. Declare, instantiate, initialize and use a one-dimensional array 2.

Declare, instantiate, initialize and use two-dimensional array Creating and Using Methods 1. Create methods and constructors with arguments and return values 2. Create and invoke overloaded methods 3. Apply the static keyword to methods and fields Reusing Implementations Through Inheritance 1. Create and use subclasses and superclasses 2.

Create and extend abstract classes 3. Enable polymorphism by overriding methods 4. Utilize polymorphism to cast and call methods, differentiating object type versus reference type 5. Distinguish overloading, overriding, and hiding Handling Exceptions 1. Describe the advantages of Exception handling and differentiate among checked exceptions, unchecked exceptions, and Errors 2. Create a try-catch block and determine how exceptions alter normal program flow 3.

Create and invoke a method that throws an exception Creating a Simple Java Program 1. Create an executable Java program with a main class 2. Introduction 3. Create and import packages Using Operators and Decision Constructs 1. Use Java operators including the use of parenthesis to override operator precedence 2. Use Java control statements including if, else, break and continue 3.

Define the structure of a Java class 3. Read or write to object fields Applying Encapsulation 1. Apply access modifiers 2. Apply encapsulation principles to a class Programming Abstractly Through Interfaces 1. Create and implement interfaces 2. Distinguish class inheritance from interface inheritance including abstract classes 3.

Declare and use List and ArrayList instances 4. Understanding lambda Expressions Understanding Modules 1. Describe the Modular JDK 2. Declare modules and enable access between modules 3. If you are using the Kindle ebook version and have an older version, you can get the most recent version by requesting Amazon support.

They will send the updated version on your device upon your request. I hope you enjoy reading this book. If you have received a review copy of this book, please mention so, in your review.

Kickstarter for Beginners This section is for Java beginners. It does not directly relate to any exam objective but is meant to provide a solid grounding that will help you to easily understand the concepts taught in later chapters. The concepts covered in this section are important because they repeat over and over throughout this book.

If we get these repetitions over with now, you will be happier later on! Kickstarter for Beginners 1. Even the international socket adapter kit, which had adapter pins of various sizes, was not of much help. I had to finally cut my cord and stick the bare copper wire ends directly into the sockets.

I wondered, why do all these sockets in the same country have slight differences. During my stay, I observed that such minor variations were present in other things as well. Most of the time, people there take the trial and error approach when replacing parts. They work with the expectation that even if they get a part with the right size, it still may not fit perfectly.

In other words, minor variations are expected and well tolerated. This was unimaginable to me in the US, where everything just fits. I could buy a bolt from one shop and a nut from another, and it would work perfectly. Everything, from screws, nuts, and bolts, to wood panels, electrical parts, packing boxes, is standardized. One can easily replace a part with another built by a totally different company. Especially, beginners from non-western background find it really tough to grasp the fundamental concepts because they do not know the rationale behind so many rules of OOP.

This is reflected in their application design. In the US, and I imagine in other developed countries as well, things are extremely well de- fined. Products clearly specify how they should be used and in what cases they will fail. People can and do rely on these specifications because products work as expected and fail as defined. At the same time, people expect products to come with detailed specifications. Ready to assemble furniture is a prime example of how detailed these specifications can be.

In short, people know exactly what they are getting when they acquire something. Object orientation is just a name for the same natural sense of things fitting nicely with each other. A piece of code is not much different from the physical things I mentioned earlier. If you code it to a specification, it will fit just as nicely as your. The point here is that the source of the concept of object-oriented programming is the physical world. If you want to grasp OOP really well, you have to start thinking of your piece of code as a physical component You should think about the same issues when you develop your software component.

But do you understand what it really means? This goes back to my previous observation about relating pro- gramming concepts to real life.

When you operate a switch do you really care about what exists inside the switch? Do you really care how it works?

You just connect the switch to a light bulb and press it to switch the bulb on or off. It is the same with a car. Included is access to Sybex's superior online interactive learning environment and test bank—containing self-assessment tests, chapter tests, bonus practice exam questions, electronic flashcards, and a searchable glossary of important terms. This indispensable guide:. There are over 9 millions developers using Java around the world, yet hiring managers face challenges filling open positions with qualified candidates.

Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental …. Develop your coding skills by exploring Java concepts and techniques such as Strings, Objects and Types, …. Thanks to useager. Fix typo in chapters 8 and 9. Fix typos in chapters 6, 7, 9, 10, 12 and Thanks to gcarravi. Fix typos in chapters 4, 16 and Thanks to robertgherlan. Fix typos in chapters 10, 21, Fix incorrect method in an example of chapter Thanks to VishGov.

Improve comment in chapter 16 and fix small errors in chapters 27 and Bad example related to DST removed in chapter Thanks to anasos. Errors fixed in chapters 1, 2, 3, 6, 7, 8, 9. Thanks to ciaranmooney. Small errors fixed in chapters 11 and Thanks to mikewittmann. Typos fixed in chapters 12, 21, 25, Thanks to DewaldDeJager. Typo fixed in chapter 2. Thanks to LeBaur. Typo fixed in question of chapter 2. Thanks to Ellephy. Typo fixed in chapter



0コメント

  • 1000 / 1000