Blog Archives

♥ Java and JAXB Tutorial – Marshaling

This blog posts extends Java and JAXB tutorial: Unmarshalling.

Q. Can you create your Java objects from XSDs?
A. Yes, you can by binding a schema. Binding a schema means generating a set of Java classes that represents the schema.

Read more ›



♥ Java and JAXB tutorial – unmarshalling

Q. What does JAXB stand for? What is an XML Binding?
A. JAXB means Java API for Xml Binding. XML binding maps an XML to in-memory Java objects. The principle advantage of using JAXB when marshaling and demarshaling XML is that is simplifies the programming model by allowing us to simply annotate a few POJOs and use the JAXB API’s and you can serialize to XML and deserialize from XML very easily.

Read more ›



♥ javap for debugging and better understanding some Java concepts with 3 practical examples

The javap is a class file dissembler. Here are 3 scenarios you can put javap to use with code examples.

#1 Finding the Java version of the class file within a jar

Extract a class file say “MyJobRunner.class” from a jar file and use javap to find out the version used

“major version: 51”

Read more ›

Tags:

♥ Top 10 Eclipse short-cut keys every Java developer using eclipse IDE must know

1. CTRL+1

Probably the most useful one. It activates the quick fix and generates lots of code for you. This means less typing.

Generating local variables: For example, if you have written a method call and you highlight it and press Ctrl+1,

Read more ›



02: ♦ Java 8 Streams, lambdas, intermediate vs terminal ops, and lazy loading with simple examples

A stream is an infinite sequence of consumable elements (i.e a data structure) for the consumption of an operation or iteration. Any Collection<T> can be exposed as a stream. It looks complex, but once you get it, it is very simple. The operations you perform on a stream can either...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home
Tags:

13: ♥♦ 5 Ways to debug Java thread-safety issues

Interviewers often judge your experience with debugging skills. For example, debugging jar hell issues, debugging SSL issues, debugging hibernate issues, debugging transaction management issues, etc. All these are covered in detail at Debugging Skills

How will you debug thread-safety issues in Java?

Read more ›



BeanIO Java tutorial

BeanIO is an open source Java framework for marshaling and marshaling Java beans from a flat file, stream, or simple String object. It is very powerful with support for XML, CSV, delimited and fixed length stream formats, Object binding, filed validation, integration with spring-batch, etc. Here is a basic tutorial to get started.

Read more ›



Debugging like a pro with eclipse IDE tutorial for Java developers

Often you get to work on a fully functional Java application that is already in production to fix production issues or to enhance its existing functionality. As a new Java developer in the team, it is not easy to get started and contributing. The approach would be slightly different from working on a brand new project.

Read more ›



Java and JSON tutorial with Jackson library

Q. What is JSON and when to favor it over XML? A. JSON (JavaScript Object Notation) is a lightweight, text-based, language-netral like XML, but less verbose than XML data exchange format. JSOJ is used in Web services to exchange data between client and server. … Read more ›...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


Java and XML tutorial with DOM Parser

Q. What is a DOM parser, and when will you use it? A. The Java DOM API for XML parsing is intended for working with small to medium XML documents as an object graph in memory. The DOM parser traverses the XML file and creates the corresponding DOM objects linked together...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


Java and XML tutorial with SAX parser – reading only

Q. What is a SAX Parser and when will you use it? A. SAX  (Simple API for XML) is a stream oriented API like StAX, but Unlike StAX, which can read and write, but SAX can only read. … Read more ›...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


Java and XML tutorial with StAX parser – reading

Q. What is a StAX Parser and when will you use it?
A. The StAX Java API for XML processing is designed for parsing XML streams, just like the SAX API’s, but

  • StAX is a “pull”

Read more ›



Java and XML tutorial with Stax Parser – writing cursor based and iterator based

Here is a simple example to write employee object to XML using simpler cursor based approach. Output: Here is a simple example to write  … Read more ›...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


Java OpenCSV tutorial to work with CSV files

BeanIO is an open source Java framework for marshaling and marshaling Java beans from a flat file, stream, or simple String object. It is very powerful with support for XML, CSV, delimited and fixed length stream formats, Object binding, filed validation, integration with spring-batch, etc. But there are scenarios where you need to simply read or write CSV data,

Read more ›



Java project with packages & jar file dependency without an IDE & build tool tutorial

Step 1: Create the following folders

1. c:\projects\learn-java is the “project folder“.

2. com\mycompany1\main & com\mycompany1\service are the “packages” under the project.

Read more ›



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

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


Remote debugging in Java with Java Debug Wire Protocol (JDWP)

What is remote debugging? It is increasingly essential with the globalization to be able to debug a Java application that is deployed remotely, in another country or city. You will come across scenarios where an application might be running fine in your sandbox (i.e. local desktop), but might be buggy...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


Top 6 Java 8 features you can start using now

Unlike Java 7, Java 8 has some significant changes. You can get familiarised with the the following simple working code. All you need is Java 8 installed on your machine.

#1: Interface can have static and default methods. This tries to solve the diamond (aka multiple inheriance) issue.

Read more ›

Tags:

Understanding Java 8 Streams and working with collections using Lambda expressions

A stream is an infinite sequence of consumable elements (i.e a data structure) for the consumption of an operation or iteration. Any Collection can be exposed as a stream. The operations you perform on a stream can either be intermediate (map, filter, sorted, … Read more ›...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


XML Parsing with JAXB implementation called MOXy

Step 1:Create a new Java project via Maven as shown below, and import the project into eclipse IDE. Step 2: The pom.xml file with the MOXy dependency. Step 3: Create a new “Source Folder” … Read more ›...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


XML processing in Java overview with a Stax reader example

Q. What APIs do Java provide to process XML? What are the pros and cons of each, and when to use what? A.  SAX: Pros: Memory efficient and faster than the DOM parser. … Read more ›...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

45-Day-Java-JEE-Career-Companion, 90-Day-Java-JEE-Career-Companion, 180-Day-Java-JEE-Career-Companion, 365-Day-Java-JEE-Career-Companion and 2-Year-Java-JEE-Career-Companion Log In | Register | Try free FAQs | Home


By topics – 800+ Q&As ♥ Free ♦ FAQ

open all | close all

Java 200+ FAQs – Quick Brushup

open all | close all

100+ Java Tutorials step by step

open all | close all

13+ Tech Key Areas to standout

open all | close all

Java coding exercises

open all | close all
Top