Blog Archives
1 8 9 10 11 12 13 14 15

Java ExecutorService with strategy design pattern to execute concurrently & sequentially

Java executor framework for running multi-threaded applications concurrently, sequentially, and with a strategy design pattern to switch between sequential and concurrent execution. 1. Running concurrently

The output will be

You can see more than 1 thread process 5 tasks concurrently. … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Java Generics in no time “? extends” & “? super” explained with a diagram

Generics in Java can be be a bit tricky to get your head around. Hope the explanation below enhances your understanding of generics. This complements 5 Java generics interview Q&As with examples. Raw List, List <Object>, and List<?> A raw List: is a heterogeneous mixture or a mixed bag that...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Java identifiers

Q1. Which of these are legal Identifiers in Java? a) $Ident1 b) _Ident1 c) -Ident1 d) 2Ident1 e) private f) private1 g) null h) Ident-1 i) Ident$1 j) \u00A3Ident1 k) \u00A5Ident1 A1. … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Java initializers, constructors, regular methods and static factory methods – when to use them with examples.

Q1. What are “static initializers” or “static blocks with no function names” in Java? A1. When a class is loaded, all blocks that are declared static and don’t have function name (i.e. static initializers) are executed even before the constructors are executed. … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Java serialization, cloning, and casting interview Q&A

Q1. Which Java interface must be implemented by a class whose instances are transported via a Web service? a. Accessible b. BeanInfo c. Remote d. Serializable A1. Answer is “d”. Q2. What is serialization? A2. … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


JDBC NamedParameterStatement versus PreparedStatement

Q. When will you use NamedParameterStatement over PreparedStatement?
A.

Reason 1:  PreparedStatement uses anonymous parameters that are accessed by index, which is ok when you have 2 or 3 parameters,

Read more ›



JDBC Overview Interview Questions and Answers

Q01. What is JDBC? How do you connect to a database?
A01. JDBC stands for Java DataBase Connectivity. It is an API which provides easy connection to a wide range of databases.

Read more ›



JMS versus AMQP, Enterprise Integration Patterns (EIP), and Spring Integration versus Apache Camel

Q. Why do you need AMQP when there is JMS?
A. AMQP stands for Advanced Message Queuing Protocol, and was developed to address the problem of interoperability by creating a standard for how messages should be structured and transmitted between platforms the same way as SMTP,

Read more ›



JTA interview Q&A

Q1. What is a Transaction? What does setAutoCommit do? A1. A transaction is a set of operations that should be completed as a unit. If one operation fails then all the other operations fail as well. For example if you transfer funds between two accounts there will be two operations...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Learning to write functional programming with Java 8 with examples

Scenario 1:  The Operation interface with the annotation @FunctionalInterface. This annotation ensures that you can only have a single abstract method. You can have additional default and static method implementations. Step 1: Define the interface. … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


Mocks, stubs, domain, and anemic objects interview Q&A

Q1. What are mock objects? A1. Mock objects are used in unit testing to ensure that your tests don’t fail due to volatility of the data changes. There are mocking frameworks like EasyMock, Mockito, and PowerMock. … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


More Java annotations interview questions & answers

Q1. What do you understand by the terms annotation types, annotations, and annotation processors? A1. An annotation type is used for defining an annotation. Java 5 defines a number of annotation types like @Override, @SuppressWarnings, @Deprecated, etc and meta annotation types that are used by annotation (i.e. … Read more...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


More JSF interview Q&A

Q1. What is the difference between initial request and postback? A1. Initial request (e.g. HTTP GET) is the request that is made from a browser in order to display a page. Postback happens when the browser posts the page back to the server with form values, … Read more ›...

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only. Register 50+ Free Java FAQs 50+ Free Big Data FAQs
Already a member? Log in here


1 8 9 10 11 12 13 14 15

300+ Java Interview FAQs

Tutorials on Java & Big Data