SlideShare a Scribd company logo
1 of 8
Download to read offline
Oracle1Z0-809 Exam
Exam-Name: Java SE 8 Programmer II
Product Version:Demo
Full Version Features:
 90 Days Free Updates
 30 Days Money Back Guarantee
 Instant Download Once Purchased
 24 Hours Live Chat Support
 Verified Answers by Experts
Demo Product – For More Information – Visit link below:
http://www.certifyschool.com/product/1Z0-809/
www.CertifySchool.com Certification Preparation Material (PDF)
Page | 2
http://www.certifyschool.com/product/1Z0-809/
Question: 1
Given:
class Book {
int id;
String name;
public Book (int id, String name) {
this.id = id;
this.name = name;
}
public boolean equals (Object obj) { //line n1
boolean output = false;
Book b = (Book) obj;
if (this.name.equals(b name))}
output = true;
}
return output;
}
}
and the code fragment:
Book b1 = new Book (101, “Java Programing”);
Book b2 = new Book (102, “Java Programing”);
System.out.println (b1.equals(b2)); //line n2
Which statement is true?
A. The program printstrue.
B. The program printsfalse.
C. A compilation error occurs. To ensure successful compilation, replaceline n1with:
boolean equals (Book obj) {
D. A compilation error occurs. To ensure successful compilation, replaceline n2with:
System.out.println (b1.equals((Object) b2));
Answer: C
Question: 2
Given the code fragment:
Path file = Paths.get (“courses.txt”);
// line n1
Assume the courses.txt is accessible.
Which code fragment can be inserted at line n1 to enable the code to print the content of the
courses.txt file?
A. List<String> fc = Files.list(file);
fc.stream().forEach(s - > System.out.println(s));
B. Stream<String> fc = Files.readAllLines (file);
fc.forEach (s - > System.out.println(s));
C. List<String> fc = readAllLines(file);
www.CertifySchool.com Certification Preparation Material (PDF)
Page | 3
http://www.certifyschool.com/product/1Z0-809/
fc.stream().forEach (s - > System.out.println(s));
D. Stream<String> fc = Files.lines (file);
fc.forEach (s - > System.out.println(s));
Answer: B
Question: 3
Which statement is true about java.time.Duration?
A. It tracks time zones.
B. It preserves daylight savingtime.
C. It defines time-based values.
D. It defines date-based values.
Answer: C
Reference:http://tutorials.jenkov.com/java-date-time/duration.html#accessing-the-time-of-
aduration
Question: 4
Given the code fragment:
List<Integer> nums = Arrays.asList (10, 20, 8):
System.out.println (
//line n1
);
Which code fragment must be inserted at line n1 to enable the code to print the maximum number
in the nums list?
A. nums.stream().max(Comparator.comparing(a -> a)).get()
B. nums.stream().max(Integer : : max).get()
C. nums.stream().max()
D. nums.stream().map(a -> a).max()
Answer: C
Question: 5
Given:
public class product {
int id; int price;
www.CertifySchool.com Certification Preparation Material (PDF)
Page | 4
http://www.certifyschool.com/product/1Z0-809/
public Product (int id, int price) {
this.id = id;
this.price = price;
}
public String toString() { return id + “:” + price; }
}
and the code fragment:
List<Product> products = Arrays.asList(new Product(1, 10),
new Product (2, 30),
new Product (2, 30));
Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> {
p1.price+=p2.price;
return new Product (p1.id, p1.price);});
products.add(p);
products.stream().parallel()
.reduce((p1, p2) - > p1.price > p2.price ? p1 : p2)
.ifPresent(System.out: :println);
What is the result?
A. 2 : 30
B. 4: 0
C. 4 : 60
D. 4 : 60
2 : 30
3 : 20
1 : 10
E. The program prints nothing.
Answer: D
Question: 6
Given the code fragment:
Path p1 = Paths.get(“/Pics/MyPic.jpeg”);
System.out.println (p1.getNameCount() +
“:” + p1.getName(1) +
“:” + p1.getFileName());
Assume that the Pics directory does NOT exist.
What is the result?
A. An exception is thrown at run time.
B. 2:MyPic.jpeg: MyPic.jpeg
C. 1:Pics:/Pics/ MyPic.jpeg
D. 2:Pics: MyPic.jpeg
Answer: C
www.CertifySchool.com Certification Preparation Material (PDF)
Page | 5
http://www.certifyschool.com/product/1Z0-809/
Question: 7
Given:
class Worker extends Thread {
CyclicBarrier cb;
public Worker(CyclicBarrier cb) { this.cb = cb; }
public void run () {
try {
cb.await();
System.out.println(“Worker…”);
} catch (Exception ex) { }
}
}
class Master implements Runnable { //line n1
public void run () {
System.out.println(“Master…”);
}
}
and the code fragment:
Master master = new Master();
//line n2
Worker worker = new Worker(cb);
worker.start();
You have been asked to ensure that the run methods of both the Worker and Master classes are
executed.
Which modification meets the requirement?
A. Atline n2, insertCyclicBarrier cb = new CyclicBarrier(2, master);
B. Replaceline n1withclass Master extends Thread {
C. Atline n2, insertCyclicBarrier cb = new CyclicBarrier(1, master);
D. Atline n2, insertCyclicBarrier cb = new CyclicBarrier(master);
Answer: B
Question: 8
Given that course.txt is accessible and contains:
Course : : Java
and given the code fragment:
public static void main (String[ ] args) {
int i;
char c;
try (FileInputStream fis = new FileInputStream (“course.txt”);
InputStreamReader isr = new InputStreamReader(fis);) {
while (isr.ready()) { //line n1
isr.skip(2);
i = isr.read ();
c = (char) i;
www.CertifySchool.com Certification Preparation Material (PDF)
Page | 6
http://www.certifyschool.com/product/1Z0-809/
System.out.print(c);
}
} catch (Exception e) {
e.printStackTrace();
}
}
What is the result?
A. ur ::va
B. ueJa
C. The program prints nothing.
D. A compilation error occurs atline n1.
Answer: A
Question: 9
Given:
public class Counter {
public static void main (String[ ] args) {
int a = 10;
int b = -1;
assert (b >=1) : “Invalid Denominator”;
8
int = a / b;
System.out.println (c);
}
}
What is the result of running the code with the –ea option?
A. -10
B. 0
C. AnAssertionErroris thrown.
D. A compilation error occurs.
Answer: B
Question: 10
Given the code fragments:
interface CourseFilter extends Predicate<String> {
public default boolean test (String str) {
return str.equals (“Java”);
}
}
and
www.CertifySchool.com Certification Preparation Material (PDF)
Page | 7
http://www.certifyschool.com/product/1Z0-809/
List<String> strs = Arrays.asList(“Java”, “Java EE”, “Java ME”);
Predicate<String> cf1 = s - > s.length() > 3;
Predicate cf2 = new CourseFilter() { //line n1
public boolean test (String s) {
return s.contains (“Java”);
}
};
long c = strs.stream()
.filter(cf1)
.filter(cf2//line n2
.count();
System.out.println(c);
What is the result?
A. 2
B. 3
C. A compilation error occurs atline n1.
D. A compilation error occurs atline n2.
Answer: A
www.CertifySchool.com Certification Preparation Material (PDF)
Page | 8
http://www.certifyschool.com/product/1Z0-809/
Demo Product – For More Information – Visit link below:
Thanks for Using Our Product
http://www.certifyschool.com/product/1Z0-809/

More Related Content

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Oracle 1Z0-809 Practice Test Questions

  • 1. Oracle1Z0-809 Exam Exam-Name: Java SE 8 Programmer II Product Version:Demo Full Version Features:  90 Days Free Updates  30 Days Money Back Guarantee  Instant Download Once Purchased  24 Hours Live Chat Support  Verified Answers by Experts Demo Product – For More Information – Visit link below: http://www.certifyschool.com/product/1Z0-809/
  • 2. www.CertifySchool.com Certification Preparation Material (PDF) Page | 2 http://www.certifyschool.com/product/1Z0-809/ Question: 1 Given: class Book { int id; String name; public Book (int id, String name) { this.id = id; this.name = name; } public boolean equals (Object obj) { //line n1 boolean output = false; Book b = (Book) obj; if (this.name.equals(b name))} output = true; } return output; } } and the code fragment: Book b1 = new Book (101, “Java Programing”); Book b2 = new Book (102, “Java Programing”); System.out.println (b1.equals(b2)); //line n2 Which statement is true? A. The program printstrue. B. The program printsfalse. C. A compilation error occurs. To ensure successful compilation, replaceline n1with: boolean equals (Book obj) { D. A compilation error occurs. To ensure successful compilation, replaceline n2with: System.out.println (b1.equals((Object) b2)); Answer: C Question: 2 Given the code fragment: Path file = Paths.get (“courses.txt”); // line n1 Assume the courses.txt is accessible. Which code fragment can be inserted at line n1 to enable the code to print the content of the courses.txt file? A. List<String> fc = Files.list(file); fc.stream().forEach(s - > System.out.println(s)); B. Stream<String> fc = Files.readAllLines (file); fc.forEach (s - > System.out.println(s)); C. List<String> fc = readAllLines(file);
  • 3. www.CertifySchool.com Certification Preparation Material (PDF) Page | 3 http://www.certifyschool.com/product/1Z0-809/ fc.stream().forEach (s - > System.out.println(s)); D. Stream<String> fc = Files.lines (file); fc.forEach (s - > System.out.println(s)); Answer: B Question: 3 Which statement is true about java.time.Duration? A. It tracks time zones. B. It preserves daylight savingtime. C. It defines time-based values. D. It defines date-based values. Answer: C Reference:http://tutorials.jenkov.com/java-date-time/duration.html#accessing-the-time-of- aduration Question: 4 Given the code fragment: List<Integer> nums = Arrays.asList (10, 20, 8): System.out.println ( //line n1 ); Which code fragment must be inserted at line n1 to enable the code to print the maximum number in the nums list? A. nums.stream().max(Comparator.comparing(a -> a)).get() B. nums.stream().max(Integer : : max).get() C. nums.stream().max() D. nums.stream().map(a -> a).max() Answer: C Question: 5 Given: public class product { int id; int price;
  • 4. www.CertifySchool.com Certification Preparation Material (PDF) Page | 4 http://www.certifyschool.com/product/1Z0-809/ public Product (int id, int price) { this.id = id; this.price = price; } public String toString() { return id + “:” + price; } } and the code fragment: List<Product> products = Arrays.asList(new Product(1, 10), new Product (2, 30), new Product (2, 30)); Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> { p1.price+=p2.price; return new Product (p1.id, p1.price);}); products.add(p); products.stream().parallel() .reduce((p1, p2) - > p1.price > p2.price ? p1 : p2) .ifPresent(System.out: :println); What is the result? A. 2 : 30 B. 4: 0 C. 4 : 60 D. 4 : 60 2 : 30 3 : 20 1 : 10 E. The program prints nothing. Answer: D Question: 6 Given the code fragment: Path p1 = Paths.get(“/Pics/MyPic.jpeg”); System.out.println (p1.getNameCount() + “:” + p1.getName(1) + “:” + p1.getFileName()); Assume that the Pics directory does NOT exist. What is the result? A. An exception is thrown at run time. B. 2:MyPic.jpeg: MyPic.jpeg C. 1:Pics:/Pics/ MyPic.jpeg D. 2:Pics: MyPic.jpeg Answer: C
  • 5. www.CertifySchool.com Certification Preparation Material (PDF) Page | 5 http://www.certifyschool.com/product/1Z0-809/ Question: 7 Given: class Worker extends Thread { CyclicBarrier cb; public Worker(CyclicBarrier cb) { this.cb = cb; } public void run () { try { cb.await(); System.out.println(“Worker…”); } catch (Exception ex) { } } } class Master implements Runnable { //line n1 public void run () { System.out.println(“Master…”); } } and the code fragment: Master master = new Master(); //line n2 Worker worker = new Worker(cb); worker.start(); You have been asked to ensure that the run methods of both the Worker and Master classes are executed. Which modification meets the requirement? A. Atline n2, insertCyclicBarrier cb = new CyclicBarrier(2, master); B. Replaceline n1withclass Master extends Thread { C. Atline n2, insertCyclicBarrier cb = new CyclicBarrier(1, master); D. Atline n2, insertCyclicBarrier cb = new CyclicBarrier(master); Answer: B Question: 8 Given that course.txt is accessible and contains: Course : : Java and given the code fragment: public static void main (String[ ] args) { int i; char c; try (FileInputStream fis = new FileInputStream (“course.txt”); InputStreamReader isr = new InputStreamReader(fis);) { while (isr.ready()) { //line n1 isr.skip(2); i = isr.read (); c = (char) i;
  • 6. www.CertifySchool.com Certification Preparation Material (PDF) Page | 6 http://www.certifyschool.com/product/1Z0-809/ System.out.print(c); } } catch (Exception e) { e.printStackTrace(); } } What is the result? A. ur ::va B. ueJa C. The program prints nothing. D. A compilation error occurs atline n1. Answer: A Question: 9 Given: public class Counter { public static void main (String[ ] args) { int a = 10; int b = -1; assert (b >=1) : “Invalid Denominator”; 8 int = a / b; System.out.println (c); } } What is the result of running the code with the –ea option? A. -10 B. 0 C. AnAssertionErroris thrown. D. A compilation error occurs. Answer: B Question: 10 Given the code fragments: interface CourseFilter extends Predicate<String> { public default boolean test (String str) { return str.equals (“Java”); } } and
  • 7. www.CertifySchool.com Certification Preparation Material (PDF) Page | 7 http://www.certifyschool.com/product/1Z0-809/ List<String> strs = Arrays.asList(“Java”, “Java EE”, “Java ME”); Predicate<String> cf1 = s - > s.length() > 3; Predicate cf2 = new CourseFilter() { //line n1 public boolean test (String s) { return s.contains (“Java”); } }; long c = strs.stream() .filter(cf1) .filter(cf2//line n2 .count(); System.out.println(c); What is the result? A. 2 B. 3 C. A compilation error occurs atline n1. D. A compilation error occurs atline n2. Answer: A
  • 8. www.CertifySchool.com Certification Preparation Material (PDF) Page | 8 http://www.certifyschool.com/product/1Z0-809/ Demo Product – For More Information – Visit link below: Thanks for Using Our Product http://www.certifyschool.com/product/1Z0-809/