Free Online Books and PDFs for Web Designers
Powered by MaxBlogPress  

Java Tutorial 2 – Writing and Running First Java Program

In the last article, we saw how to setup Java environment on Windows, now we are ready to write and run our first java program.

To keep things simple and working for newbie, here is the sample program that you can use.

public class MyFirstClass { public static void main(String args[]){ System.out.println("Welcome to JournalDev."); } . . . → Read More: Java Tutorial 2 – Writing and Running First Java Program

Java Tutorial 1 – Setting up Java Environment on Windows

If you are new to Java then this is the first step you need to perform. Until unless your Java environment is setup properly, you will not be able to develop java programs and run them successfully.

Step 1:

Download JDK from Oracle’s website based on your operating system.

If you are on Windows OS, . . . → Read More: Java Tutorial 1 – Setting up Java Environment on Windows

Generate QR Code image from Java Program

If you are tech and gadget savvy, then you must be aware of QR codes. You will find it everywhere these days – in blogs, websites and even in some public places. This is very popular in mobile apps, where you scan the QR code using a QR Code scanner app and it will show . . . → Read More: Generate QR Code image from Java Program

SOAP XML Message – Understanding and Creating with Liquid XML Studio

What Is SOAP?

Soap is an Xml based transport protocol. Soap stands for Simple Object Access Protocol. Soap is a lightweight mechanism for exchanging structured and typed information. As it is XML based so it is language and platform independent. SOAP has been a widely accepted protocol for XML based system- to- system communications so . . . → Read More: SOAP XML Message – Understanding and Creating with Liquid XML Studio

How to Avoid ConcurrentModificationException when using an Iterator

Java Collection classes are fail-fast which means that if the Collection will be changed while some thread is traversing over it using iterator, the iterator.next() will throw ConcurrentModificationException. This situation can come in case of multithreaded as well as single threaded environment. . . . → Read More: How to Avoid ConcurrentModificationException when using an Iterator

5 Java Programming Test Questions for Interview

Recently I am taking a lot of interview for my organization. So I was in the search of some java programming test questions that are little bit tricky also. Here I am providing five of the tricky questions I found interesting and need a closer look to understand. The explanation will be provided after the questions. Test your knowledge of java by trying to provide the answer of the below test questions. . . . → Read More: 5 Java Programming Test Questions for Interview

Java Interview Questions: Understanding and Extending Java ClassLoader

The Java ClassLoader is one of the crucial but rarely used components of Java in Project Development. Personally I have never extended ClassLoader in any of my projects but the idea of having my own ClassLoader that can customize the Java Class Loading thrills me. This article will provide an overview of Java Class Loading and then move forward to create a custom ClassLoader and use it. What is a ClassLoader? We know that Java Program runs on Java Virtual Machine (JVM). When we compile a Java Class, it transforms it in the form of bytecode that is platform and machine independent compiled program and store it as a .class file. After that when we try to use a Class, Java ClassLoader loads that class into memory. There are three types of built-in Class Loaders in Java: 1. Bootstrap Class Loader – It loads JDK internal classes, typically loads rt.jar and other core classes for example java.lang.* package classes 2. Extensions Class Loader – It loads classes from the JDK extensions directory, usually $JAVA_HOME/lib/ext directory. 3. System Class Loader – It loads classes from the current classpath that can be set while invoking a program using -cp or -classpath command line options. Java Class Loaders are hierarchical and whenever a request is raised to load a class, it delegates it to its parent and in this way uniqueness is maintained in the runtime environment. If the parent class loader doesn’t find the class then the class loader itself tries to load the class. . . . → Read More: Java Interview Questions: Understanding and Extending Java ClassLoader

Read File in Java – Line by Line, Read by Number of Bytes, Count of String occurrence in File

In my last post, I was going through with different options we have for SimpleDateFormat. Today I am providing a program for reading file in Java. I am using BufferedReader for reading the file because it buffers the input from the specified file. Without buffering, each invocation of read() or readLine() could cause bytes to be read from the file, converted into characters, and then returned, which can be very inefficient. Here I am providing three functions. 1. Read complete file as String 2. Read file line by line and return list of String 3. Count the occurrence of a String in the given file. . . . → Read More: Read File in Java – Line by Line, Read by Number of Bytes, Count of String occurrence in File

SimpleDateFormat Example with Formats, Patterns and Date Conversion

SimpleDateFormat is the Java class for formatting and parsing dates with Locale support. You can format date to text and vice-versa using SimpleDateFormat class. This class is very useful in formatting date to display in UI in specific pattern. SimpleDateFormat is the concrete class that extends DateFormat abstract class. Date and Time formats are specified by patterns, which are nothing but a String. In pattern every letter has its specific meaning. For example, y is for year, M is for month in year and m is for minutes in Hour. In the below attached code, we will see the different usage of SimpleDateFormat class with different string patterns. . . . → Read More: SimpleDateFormat Example with Formats, Patterns and Date Conversion

AXIS2 Web Services Tutorial

Recently I was trying to upgrade my Apache Axis2 skills from 1.3 to latest version 1.5.4 and I was not able to find out any tutorial that is self-explanatory and covering the latest release. So it forms the basis of my post for Axis2 Web Services Tutorial. Who Should Use This Tutorial This tutorial is intended for Java programmers who are interested in developing and deploying Web Services using Apache Axis2. Prerequisites The scope of this tutorial is to use Axis2 for creating web services and invoking the web service using Java client program and testing web service using Soap UI tool. Basic understanding of Java, Web Services, XML, Ant and application server (Tomcat) is required to understand the tutorial with ease. . . . → Read More: AXIS2 Web Services Tutorial

Page 1 of 3123