🎓 Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (178K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
In Oracle Java Certification Exam Sample Questions - Part 1, we have seen a few Oracle Java Certification exam sample questions. In part 2, we will see a few more sample questions which will help to prepare for the exam.
2. B and E
3. A
4. C
5. D
Check out Part 1 - Oracle Java Certification Exam Sample Questions - Part 1.The answer to each question has given at end of this post.
1. Which is a valid functional interface?
A)
public interface Useful<E> {
E getStuff();
void putStuff(E e);
}
B)
public interface Useful {
void doStuff();
default void doOtherStuff() {}
}
C)
@FunctionalInterface
public interface Useful{
default void doStuff(){}
}
D)
public interface Useful {
abstract void doStuff();
abstract void doCalc();
}
2. Given:
public abstract class Customer {
private String name;
public Customer(String name) {
this.name = name;
}
public String getName() {
return name;
}
public abstract void buy();
}
Which two statements are true about Customer?
A) The Customer class cannot be extended.
B) The Customer class cannot be instantiated.
C) Subclasses of Customer cannot override getName() method.
D) Concrete subclasses of Customer must use a default constructor.
E) Concrete subclasses of Customer must implement the buy() method.
F) Subclasses of Customer must implement the buy() method.
3. Given the code fragment:
import java.util.ArrayDeque;
import java.util.Queue;
public class App {
public static void main(String[] args) {
Queue < String > products = new ArrayDeque < String > ();
products.add("p1");
products.add("p2");
products.add("p3");
System.out.print(products.peek());
System.out.print(products.poll());
System.out.println("");
products.forEach(s - > System.out.print(s));
}
}
What is the result?
A.
p1p1
p2p3
B.
p1p2
p1p2p3
C.
p1p2
p3
D.
p1p1
p1p2p3
4. Given the code fragment:
try (Connection con = DriverManager.getConnection(url, uname, pwd)) {
Statement stmt = con.createStatement();
System.out.print(stmt.executeUpdate("INSERT INTO User VALUES (500,'Ramesh')"));
}
Assuming the SQL query executes properly, what is the result?
A) true
B) false
C) 1
5. Given the code fragment:
public class TestFun {
public static void main(String[] args) {
List<Integer> nums = Arrays.asList(1,2,3,4,5);
// Line n1
}
}
Which code fragment can be inserted at Line n1 to enable the code to print 2 4?
A)
nums.peek(n -> n%2 == 0)
.forEach( s -> System.out.print(" "+s));
B)
nums.filter(n -> n%2 == 0)
.forEach( s -> System.out.print(" "+s));
C)
nums.map(n -> n%2 == 0)
.forEach( s -> System.out.print(" "+s));
D)
nums.stream()
.filter(n -> n%2 == 0)
.forEach( s -> System.out.print(" "+s));
Answers
1. B2. B and E
3. A
4. C
5. D
My Top and Bestseller Udemy Courses. The sale is going on with a 70 - 80% discount. The discount coupon has been added to each course below:
Build REST APIs with Spring Boot 4, Spring Security 7, and JWT
🆕 High-Demand
80–90% OFF
[NEW] Learn Apache Maven with IntelliJ IDEA and Java 25
🆕 High-Demand
80–90% OFF
ChatGPT + Generative AI + Prompt Engineering for Beginners
🚀 Trending Now
80–90% OFF
Spring 7 and Spring Boot 4 for Beginners (Includes 8 Projects)
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Building Real-Time REST APIs with Spring Boot - Blog App
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Building Microservices with Spring Boot and Spring Cloud
🌟 Top Rated
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Java Full-Stack Developer Course with Spring Boot and React JS
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Build 5 Spring Boot Projects with Java: Line-by-Line Coding
🌟 Top Rated
80–90% OFF
Testing Spring Boot Application with JUnit and Mockito
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Spring Boot Thymeleaf Real-Time Web Application - Blog App
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Master Spring Data JPA with Hibernate
🔥 Bestseller
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Spring Boot + Apache Kafka Course - The Practical Guide
🎓 Student Favorite
80–90% OFF
Available in Udemy for Business
Available in Udemy for Business
Comments
Post a Comment
Leave Comment