How to check if an integer number is power of 2 in Java is one of the popular programming interview question and has been asked in many interviews. Surprisingly, this problem which looks simple enough to answer, doesn't turn out that simple if for many developers. Many Java programmers, both freshers and less experienced, struggle to write code for a function, which can check if number is power of 2 or not. There could be many different reasons for that, but it’s expected to at least come up with brute force solution. For those who are familiar with bitwise operators in Java , how positive and negative numbers are represented in binary format, this exercise is quite easy. Since negative numbers are represented as 2's complement value in Java, you can easily find if any number is power of 2 or not by looking at its bit pattern. Remember checking for power of two is different than checking if number is even or odd, that’s another thing to note. A number can be even, but it’s not necessary to be a power of two, e.g. 6 is even but it’s not a power of two.
Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts
Spring Framework How to compare Arrays in Java – Equals vs deepEquals Example
java.util.Arrays class provides equals() and deepEquals() method to compare two Arrays in Java. Both of these are overloaded method to compare primitive arrays e.g. int, long, float, double and Object arrays e.g. Arrays.equals(Object[] , Object[]). Arrays.equals() returns true if both Arrays which it is comparing are null, If both array pointing to same Array Object or they must be of same length and contains same element in each index. In all other cases it returns false. Arrays.equals() calls equals() method of each Object while comparing Object arrays. One of the tricky question in Java related to Array comparison is Difference between Arrays.equals() and Arrays.deepEquals() method. Since both equals and deepEquals is used for array comparison, what is difference between them becomes important. Short answer of this questions is that, Array's equals() method does not perform deep comparison and fails logical comparison in case of nested Array, on other hand deepEquals() perform deep comparison and returns logical comparison in case of nested array.
Labels:
coding,
core java,
java collection tutorial,
programming
Spring Framework What is static import in Java 5 with Example
Static import in Java allows to import static members of class and use them, as they are declared in the same class. Static import is introduced in Java 5 along with other features like Generics, Enum, Autoboxing and Unboxing and variable argument methods. Many programmer think that using static import can reduce code size and allow you to freely use static field of external class without prefixing class name on that. For example without static import you will access static constant MAX_VALUE of Integer class as Integer.MAX_VALUE but by using static import you can import Integer.MAX_VALUE and refer it as MAX_VALUE. Similar to regular importstatements, static import also allows wildcard * to import all static members of a class. In next section we will see Java program to demonstrate How to use static import statements to import static fields.
Labels:
coding,
core java,
java 5 tutorial,
programming
Spring Framework Java coding -- reverse enum lookup and sorting objects with a comparator
This blog post covers three core Java concepts:
1) Writing value objects to store data.
2) Writing enum classes with reverse look-up.
3) Lastly, but most importantly custom sorting your value objects with a comparator.
Step 1: Writing your value object class.
The hashCode( ), equals( Object obj), and toString( ) methods from the Java Object class are over written. It also implements the Serializable interface to make the object serializable (i.e. can be flattened to bytes).
Step 2a: Writing a simple enum class.
Step 2b: Writing an enum class with reverse look-up using a Map.
Step 3: Writing a comparator class to sort a collection of value objects.
As you could see, you need to implement the compare(Object obj1, Object obj2) method. This method has been written with fail fast in mind. As you can see, the input fields are validated, and exception is thrown if validation fails.
Step 4: Finally, how to use the comparator.
1) Writing value objects to store data.
2) Writing enum classes with reverse look-up.
3) Lastly, but most importantly custom sorting your value objects with a comparator.
Step 1: Writing your value object class.
package com.myapp.model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class CashForecastSummary implements Serializable
{
private static final long serialVersionUID = 2663449836220393299L;
private String portfolioCode;
private Date valuationDate;
private String accountCd;
private BigDecimal totalAmount = BigDecimal.ZERO;
private String currencyCode;
private String transactionTypeDesc;
private ForecastDay foreCastDay;
private Date foreCastDate;
private RecordType recordType;
public String getPortfolioCode() {
return portfolioCode;
}
public void setPortfolioCode(String portfolioCode) {
this.portfolioCode = portfolioCode;
}
public Date getValuationDate() {
return valuationDate;
}
public void setValuationDate(Date valuationDate) {
this.valuationDate = valuationDate;
}
public String getAccountCd() {
return accountCd;
}
public void setAccountCd(String accountCd) {
this.accountCd = accountCd;
}
public BigDecimal getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(BigDecimal totalAmount) {
this.totalAmount = totalAmount;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
public String getTransactionTypeDesc() {
return transactionTypeDesc;
}
public void setTransactionTypeDesc(String transactionTypeDesc) {
this.transactionTypeDesc = transactionTypeDesc;
}
public ForecastDay getForeCastDay() {
return foreCastDay;
}
public void setForeCastDay(ForecastDay foreCastDay) {
this.foreCastDay = foreCastDay;
}
public Date getForeCastDate() {
return foreCastDate;
}
public void setForeCastDate(Date foreCastDate) {
this.foreCastDate = foreCastDate;
}
public RecordType getRecordType() {
return recordType;
}
public void setRecordType(RecordType recordType) {
this.recordType = recordType;
}
@Override
public String toString()
{
return "CashForecastSummary [portfolioCode=" + portfolioCode
+ ", valuationDate=" + valuationDate + ", accountCd="
+ accountCd + ", totalAmount=" + totalAmount
+ ", currencyCode=" + currencyCode + ", transactionTypeDesc="
+ transactionTypeDesc + ", foreCastDay=" + foreCastDay
+ ", recordType=" + recordType + "]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((accountCd == null) ? 0 : accountCd.hashCode());
result = prime * result
+ ((foreCastDay == null) ? 0 : foreCastDay.hashCode());
result = prime
* result
+ ((transactionTypeDesc == null) ? 0 : transactionTypeDesc
.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CashForecastSummary other = (CashForecastSummary) obj;
if (accountCd == null) {
if (other.accountCd != null)
return false;
} else if (!accountCd.equals(other.accountCd))
return false;
if (foreCastDay != other.foreCastDay)
return false;
if (transactionTypeDesc == null) {
if (other.transactionTypeDesc != null)
return false;
} else if (!transactionTypeDesc.equals(other.transactionTypeDesc))
return false;
return true;
}
}
The hashCode( ), equals( Object obj), and toString( ) methods from the Java Object class are over written. It also implements the Serializable interface to make the object serializable (i.e. can be flattened to bytes).
Step 2a: Writing a simple enum class.
package com.myapp.model;
public enum RecordType
{
OPENING_BALANCE(1),
DETAILS(2),
CLOSING_BALANCE(3);
private final int recordType;
private RecordType(int recordType)
{
this.recordType = recordType;
}
public int getRecordType()
{
return recordType;
}
}
Step 2b: Writing an enum class with reverse look-up using a Map.
package com.myapp.model;
import java.util.HashMap;
import java.util.Map;
public enum ForecastDay {
T(0), T1(1), T2(2), T3(3), T4(4), T5(5), T6(6), T7(7), T8(8), T9(9), T10(10), T11(11), T12(12), T13(13), TN(14);
// Reverse-lookup map for getting a day from an abbreviation
private static final Map<Integer, ForecastDay> lookup = new HashMap<Integer, ForecastDay>();
static {
for (ForecastDay d : ForecastDay.values())
lookup.put(d.getDaycount(), d);
}
private final int dayCount;
private ForecastDay(int dayCount) {
this.dayCount = dayCount;
}
public int getDaycount() {
return dayCount;
}
public static ForecastDay getDayFromCount(int dayCount) {
if (dayCount > 13) {
dayCount = 14;
}
return lookup.get(dayCount);
}
}
Step 3: Writing a comparator class to sort a collection of value objects.
package com.myapp.model.sort;
import java.util.Comparator;
import com.myapp.model.CashForecastSummary;
public class CashForecastSummaryComparator implements Comparator<CashForecastSummary> {
@Override
public int compare(CashForecastSummary o1, CashForecastSummary o2) {
int result = 1;
String accountCd1 = o1.getAccountCd();
String accountCd2 = o2.getAccountCd();
if (accountCd1 == null || accountCd2 == null) {
throw new IllegalArgumentException("The account codes cannot be null " + " accountCd1=" + accountCd1 + ", accountCd2=" + accountCd2);
}
result = accountCd1.compareTo(accountCd2);
if (result != 0) {
return result;
}
Integer forecastDay1 = o1.getForeCastDay().getDaycount();
Integer forecastDay2 = o2.getForeCastDay().getDaycount();
if (forecastDay1 == null || forecastDay2 == null) {
throw new IllegalArgumentException("The forecastDay cannot be null " + " forecastDay1=" + forecastDay1 + ", forecastDay2=" + forecastDay2);
}
result = forecastDay1.compareTo(forecastDay2);
if (result != 0) {
return result;
}
Integer recType1 = o1.getRecordType().getRecordType();
Integer recType2 = o2.getRecordType().getRecordType();
if (recType1 == null || recType2 == null) {
throw new IllegalArgumentException("The recordType cannot be null " + " recType1=" + recType1 + ", recType2=" + recType2);
}
result = recType1.compareTo(recType2);
if (result != 0) {
return result;
}
result = o1.getTransactionTypeDesc().compareTo(o2.getTransactionTypeDesc());
return result;
}
}
As you could see, you need to implement the compare(Object obj1, Object obj2) method. This method has been written with fail fast in mind. As you can see, the input fields are validated, and exception is thrown if validation fails.
Step 4: Finally, how to use the comparator.
....
/**
* takes unsorted values as an argument and returns the sorted values
*/
public List<CashForecastSummary> getSortedSummariesForBalanceUpdate(List<CashForecastSummary> values) {
Collections.sort(values, new CashForecastSummaryComparator());
return values;
}
....
Spring Framework How to find middle element of LinkedList in Java in one pass
How do you find middle element of LinkedList in one pass is a programming question often asked to Java and non Java programmers in telephonic Interview. This question is similar to checking palindrome or calculating factorial, where Interviewer some time also ask to write code. In order to answer this question candidate must be familiar with LinkedList data structure i.e. In case of singly LinkedList, each node of Linked List contains data and pointer, which is address of next Linked List and last element of Singly Linked List points towards null. Since in order to find middle element of Linked List you need to find length of LinkedList, which is counting elements till end i.e. until you find the last element on Linked List. What makes this data structure Interview question interesting is that you need to find middle element of LinkedList in one pass and you don’t know length of LinkedList. This is where candidates logical ability puts into test, whether he is familiar with space and time trade off or not etc. As if you think carefully you can solve this problem by using two pointers as mentioned in my last post on How to find length of Singly Linked List in Java. By using two pointers, incrementing one at each iteration and other at every second iteration. When first pointer will point at end of Linked List, second pointer will be pointing at middle node of Linked List. In fact this two pointer approach can solve multiple similar problems e.g. How to find 3rd element from last in a Linked List in one Iteration or How to find nth element from last in a Linked List. In this Java programming tutorial we will see a Java program which finds middle element of Linked List in one Iteration.
Labels:
coding,
core java,
core java interview question,
programming
Spring Framework Recursion in Java with example – Programming Techniques Tutorial
Recursion is one of the tough programming technique to master. Many programmers working on both Java and other programming language like C or C++ struggles to think recursively and figure out recursive pattern in problem statement, which makes it is one of the favorite topic of any programming interview. If you are new in Java or just started learning Java programming language and you are looking for some exercise to learn concept of recursion than this tutorial is for you. In this programming tutorial we will see couple of example of recursion in Java programs and some programming exercise which will help you to write recursive code in Java e.g. calculating Factorial, reversing String and printing Fibonacci series using recursion technique. For those who are not familiar with recursion programming technique here is the short introduction: "Recursion is a programming technique on which a method call itself to calculate result". Its not as simple as it look and mainly depends upon your ability to think recursively. One of the common trait of recursive problem is that they repeat itself, if you can break a big problem into small junk of repetitive steps then you are on your way to solve it using recursion.
Labels:
coding,
core java,
programming
Spring Hibernate JSTL foreach tag example in JSP - looping ArrayList
JSTL foreach loop in JSP
JSTL foreach tag is pretty useful while writing Java free JSP code. JSTL foreach tag allows you to iterate or loop Array List, HashSetor any other collection without using Java code. After introduction of JSTL and expression language(EL) it is possible to write dynamic JSP code without using scriptlet which clutters jsp pages. JSTL foreach tag is a replacement of for loop and behaves similarly like foreach loop of Java 5 but still has some elements and attribute which makes it hard for first-timers to grasp it. JSTL foreach loop can iterate over arrays, collections like List, Setand print values just like for loop. In this JSP tutorial we will see couple of example of foreach loop which makes it easy for new guys to understand and use foreach loop in JSP. By the way this is our second JSP tutorial on JSTL core library, in last tutorial we have seen How to use core <c:set> tag in JSP page.
Labels:
coding,
interview questions,
JSP,
JSTL,
programming
Spring Framework How to check if a number is a palindrome or not in Java - Example
How to check if a number is a palindrome or not is a variant of popular String interview question how to check if a String is a palindrome or not. A number is said to be a palindrome if number itself is equal to reverse of number e.g. 313 is a palindrome because reverse of this number is also 313. On the other hand 123 is not a palindrome because reverse of 123 is 321 which is not equal to 123, i.e. original number. In order to check if a number is a palindrome or not we can reuse the logic of How to reverse number in Java. Since in most of interview, you are supposed to solve this question without taking help from API i.e. only using basic programming construct e.g. loop, conditional statement, variables, operators and logic. I have also seen programmer solving this question by first converting integer to String and than reversing String using reverse() method of StringBuffer and than converting String back to Integer, which is not a correct way because you are using Java API. Some programmer may think that this is just a trivial programming exercise but it’s not. Questions like this or Fibonacci series using recursion can easily separate programmers who can code and who can’t. So it’s always in best interest to keep doing programing exercise and developing logic.
Labels:
coding,
core java,
core java interview question,
programming
Spring Framework Inner class and nested Static Class in Java with Example
Inner class and nested static class in Java both are classes declared inside another class, known as top level class in Java. In Java terminology, If you declare a nested class static, it will called nested static class in Java while non static nested class are simply referred as Inner Class. Inner classes are also a popular topic in Java interviews. One of the popular question is difference between inner class and nested static class , some time also refereed as difference between static and non static nested class in Java. One of the most important question related to nested classes are Where should you use nested class in Java? This is one of the tricky Java question, If you have read Effective Java from Joshua Bloch than in one chapter he has suggested that if a class can only be useful to one particular class, it make sense to keep that inside the class itself otherwise declare it as top level class. Nested class improves Encapsulation and help in maintenance. I actually look JDK itself for examples and if you look HashMap class, you will find that Map.Entry is a good example of nested class in Java. Another popular use of nested classes are implementing Comparator in Java e.g. AgeCompartor for Person class. Since some time Comparator is also tied with a particular class, it make sense to declare them as nested static class in Java. In this Java tutorial we will see what is Inner class in Java, different types of Inner classes, what is static nested classand finally difference between static nested class and inner class in Java.
Labels:
coding,
core java,
core java interview question,
programming
Spring Framework What is Type Casting in Java - Casting one Class to other class or interface Example
Type casting in Java is to cast one type, a class or interface, into another type i.e. another class or interface. Since Java is an Object oriented programming language and supports both Inheritance and Polymorphism, It’s easy that Super class reference variable is pointing to Sub Class object but catch here is that there is no way for Java compiler to know that a Super class variable is pointing to Sub Class object. Which means you can not call method which is declared on sub class. In order to do that, you first need to cast the Object back into its original type. This is called type-casting in Java. This will be more clear when we see an example of type casting in next section. Type casting comes with risk of ClassCastException in Java, which is quite common with method which accept Object type and later type cast into more specific type. we will see when ClassCastException comes during type casting and How to avoid it in coming section of this article. Another worth noting point here is that from Java 5 onwards you can use Generics to write type-safe codeto reduce amount of type casting in Java which also reduces risk of java.lang.ClassCastException at runtime.
Labels:
coding,
core java,
object oriented programming
Spring Framework How to convert String to long in Java - 4 Examples
How to convert string to long in Java is one of those frequently asked questions by beginner who has started learning Java programming language and not aware of how to convert from one data type to another. Converting String to long is similar to converting String to Integer in Java, in-fact if you know how to convert String to Integer than you can convert String to Long by following same procedure. Though you need to remember few things while dealing with long and String first of all long is primitive type which is wrapped by Long wrapper class and String is an Object in Java backed by character array. Before Java 5 you need to take an extra step to convert Long object into long primitive but after introduction of autoboxing and unboxing in Java 5, Java language will perform that conversion for you. This article is in continuation of our previous conversion tutorial like how to convert String to Double in Java or how to convert String to Enum in Java. In this Java tutorial we will learn 3 different ways to convert String to long by code example and we will also analyze pros and cons of each approach.
Labels:
coding,
core java,
programming
Spring Framework Difference between valueOf and parseInt method in Java
Both valueOf and parseInt methods are used to convert String to Integer in Java, but there are subtle difference between them. If you look at code of valueOf() method, you will find that internally it calls parseInt() method to convert Integer to String, but it also maintains a pool of Integers from -128 to 127 and if requested integer is in pool, it returns object from pool. Which means two integer objects returned using valueOf() method can be same by equality operator. This caching of Immutable object, does help in reducing garbage and help garbage collector. Another difference between parseInt() and valueOf() method is there return type. valueOf() of java.lang.Integer returns an Integer object, while parseInt() method returns an int primitive. Though, after introducing Autoboxing in Java 1.5, this doesn't count as a difference, but it's worth knowing.
Labels:
coding,
core java,
Java Programming Tutorials
Spring Framework How to initialize List with Array in Java - One Liner Example
Initializing list while declaring it is very convenient for quick use. If you have been using Java programming language for quite some time then you must be familiar with syntax of array in Java and how to initialize an arrayin the same line while declaring it as show below:
String[] oldValues = new String[] {"list" , "set" , "map"};
or even shorter :
String[] values = {"abc","bcd", "def"};
Similarly we can also create List and initialize it at same line, popularly known as initializing List in one line example. Arrays.asList() is used for that purpose which returns a fixed size List backed by Array. By the way don’t confuse between Immutable or read only List which doesn’t allow any modification operation including set(index) which is permitted in fixed length List.Here is an example of creating and initializing List in one line :
Labels:
coding,
core java,
java collection tutorial,
programming
Spring Hibernate Eclipse shortcut to System.out.println in Java program - Tips
Eclipse IDE provides quick shortcut keys to print System.out.println statement in Java but unfortunately not every Java programmers are familiar of that. Even programmers with 3 to 4 year of experience sometime doesn't know this useful Eclipse shortcut to generate System.out.println messages. This Eclipse tips is to help those guys. Let me ask you one question, How many times you type System.out.println in your Java program? I guess multiple time, while doing programming, debuggingand testing small stuff. System.out.println is most preferred way to print something on console because it doesn’t required setup like configuring Log4J or java.util.Logger . Though I recommend using logging for better information display in production code, nobody can undermine importance of System.out.println statement in Java. On the quest of learning Eclipse shortcut, some of them which I have discussed in my list of Top 30 Eclipse shortcut for Java programmers, I found a very useful Eclipse shortcut for generating code for System.out.println statement in Java source file. By using this Eclipse shortcut you can create System.out.println() messages in 60% less time, as you only need to type the message. This Eclipse shortcut will place your cursor right in the place, where it should be i.e. inside System.out.println method.
Labels:
coding,
core java,
Eclipse,
programming
Spring Hibernate Java program to calculate area of Triangle - Homework, programming exercise example
Calculate area of Triangle in Java
Write a Java program to calculate Area of Triangle, accept input from User and display output in Console is one of the frequently asked homework question. This is not a tough programming exercise but a good exercise for beginners and anyone who has started working in Java. For calculating area of triangle using formula 1/2(base*height), you need to use arithmetic operator. By doing this kind of exercise you will understand how arithmetic operators works in Java, subtle details which affect calculation like precedence and associativity of operator etc. Fortunately this question is not very popular on Java interview like other exercise we have seen e.g. Java program to print Fibonacci series and Java program to check for palindrome. Nevertheless its a good Java homework.
Labels:
coding,
core java,
homework,
programming
Spring Framework How to get current date, month, year and day of week in Java program
Here is quick Java tip to get current date, month, year and day of week from Java program. Java provides a rich Date and Time API though having thread-safety issue but its rich in function and if used locally can give you all the date and time information which you need for your enterprise Java application. In last Java tutorial on Date and Time API we have seen how to get current date and time from different timezone using DateFormat and SimpleDateFormat classes and in this post we will get some more details like current month, year, day of week etc by using java.util.Calendar class. Just keep in mind that Calendar instance should not be shared between multiple threads. Calendar class in Java provides different fields to get different information e.g. Calendar.DATE gives you current date while Calendar.MONTH gives you current month based on what type of Calendar you are using, which depends upon locale.
Labels:
coding,
core java,
date and time tutorial,
programming
Spring Framework How to create and modify Properties file form Java program in Text and XML format
Though most of the time we create and modify properties file using text editor like notepad, word-pad or edit-plus, It’s also possible to create and edit properties file from Java program. Log4j.properties, which is used to configure Log4J based logging in Java and jdbc.properties which is used to specify configuration parameters for database connectivity using JDBC are two most common example of property file in Java. Though I have not found any real situation where I need to create properties file using Java program but it’s always good to know about facilities available in Java API. In last Java tutorial on Properties we have seen how to read values from properties file on both text and XML format and in this article we will see how to create properties file on both text and XML format. Java API’s java.util.Properties class provides several utility store() methods to store properties in either text or xml format. Store() can be used to store property in text properties file and storeToXML() method can be used for creating a Java property file in XML format.
Labels:
coding,
core java,
Java xml tutorial,
programming
Spring Framework How to count occurrence of a character in String - Java programming exercise
Write a program to count number of occurrence of a character in String is one of common programming interview question not just in Java but also in other programming language like C or C++. As String in a very popular topic on programming interviews and there are lot of good programming exercise on String like "count number of vowels or consonants in String", "count number of characters in String" , How to reverse String in Java using recursion or without using StringBuffer etc, it becomes extremely important to have solid knowledge of String in Java or any other programming language. In Interview, most of the time Interviewer will ask you to write program without using any API method, as Java is very rich and it always some kind of nice method to do the job, But it also important to know rich Java and open source libraries for writing production quality code. Anyway in this question we will see both API based and non API based(except few) way of to count number of occurrence of a character in String on Java.
Labels:
coding,
core java,
core java interview question,
programming
Spring Framework How to read input from command line in Java using Scanner
Java 5 introduced a nice utility called java.util.Scanner which is capable to read input form command line in Java. Using Scanner is nice and clean way of retrieving user input from console or command line. Scanner can accept InputStream, Reader or simply path of file from where to read input. In order to reading from command line we can pass System.in into Scanner's constructor as source of input. Scanner offers several benefit over classical BufferedReader approach, here are some of benefits of using java.util.Scanner for reading input from command line in Java:
Labels:
coding,
core java,
homework,
programming
Spring Framework 2 ways to combine Arrays in Java – Integer, String Array Copy Example
There are multiple ways to combine or join two arrays in Java, both for primitive like int array and Object e.g. String array. You can even write your own combine() method which can use System.arrayCopy() to copy both those array into third array. But being a Java developer, I first looked in JDK to find any method which concatenate two arrays in Java. I looked at java.util.Arrays class, which I have used earlier to compare two arrays and print arrays in Java, but didn't find a direct way to combine two arrays. Then I looked into Apache Commons, ArrayUtils class and bingo, it has several overloaded method to combine int, long, float, double or any Object array. Later I also found that Guava ,earlier known as Google collections also has a class ObjectArrays in com.google.common.collect package, which can concatenate two arrays in Java. It's always good to add Apache commons and Guava, as supporting library in Java project, they have lots of supporting classes, utility and method, which complements rich Java API. In this Java programming tutorial, we will see example of these 2 ways to combine, join or concatenate two arrays in Java and will write a method in core Java to concatenate two int arrays in Java.
Labels:
coding,
core java,
Java Programming Tutorials
Subscribe to:
Posts (Atom)
Labels
.equals
= operator
abstract class
abstract method
abstract window toolkit
Access Modifiers
accessing java beans
accessing javabeans
action events
actionperformed
active
addition
Advanced
Advanced Overloading
AdvJavaBooks
Agile development
ajax
alive
AMQP
and
Android
anonymous class
anonymous inner class
Ant
ant tutorials
anti patterns
antipatterns
Apache Camel
api for jsp
api for servlet
api for servlets
api jsp
application context
application scope
application session
Apps
Architecture
are you eligible for the ocmjd certificaiton
are you eligible for the scjd certification
arithmetic operator
arpanet
array construction
array declaration
array initialization
array list
array to list conversion
arraylist
arraylist of strings
arraylist of types
arraylist questions
arraylists
Arrays
arrays in java
ask for help
assert
assert in java
assertions
assertions in java
assignment
assignment operator
Atlassian
attribute visibility
authentication
authorization
autoboxing
autounboxing
awt
AWT Event Handling
awt interview questions
AWT Layouts
awt questions
awt questions and answers
backed collection
backed collections
Basic
Basics of event handling
bean attributes
bean properties
bean scope
Beginner
best practices
BigData
blocked
books
boxing
buffer size
bufferedreader
bufferedwriter
business delegate
business delegate pattern
calendar
case statement
casting in java
casting interview questions
chapter review
choosing a java locking mechanism
choosing a locking mechanism
choosing a thread locking mechanism
class inside a method
class questions
class with no name
class without a name
classes interview questions
Clipboard
closing jsp tags
code snap
coding
cohesion
collection generics
collection interview questions
collection methods
collection of types
collection questions
collection searching
collection types
Collections
Collections Framework
collections interview questions
collections sorting
colors in java swings
colors in swing
command line arguments
communication between threads
comparable
comparator
comparison operators
compiling java classes
computers
concurrency example and tutorial
config
Configuration
ConnectionPooling
constructor creation
constructor interview questions
constructor overloading
constructors in java
containers
contents of deployment descriptor
contents of web.xml
context
context scope
converting array to list
converting list to array
core java
core java interview
core java interview question
core java interview questions
core java questions
core java;
core java; object oriented programming
CoreJava
CoreJavaBooks
CORS
coupling
create threads
creating 2 dimensional shapes
creating 2D shapes
creating a frame
creating a jframe
creating a thread
creating an arraylist
creating an inner class
creating an interface
creating java beans
creating java threads
creating javabeans
creating threads
creating threads in java
CSS
cURL
currency
current thread determination
custom tag library
custom taglib
custom taglibs
custom tags
CVS
dao
dao design pattern
dao factory pattern
dao pattern
data access object
data access object pattern
data structure and algorithm
database
date and time tutorial
date format
dateformat
dates
deadlock
deadlocks
debugging
Declarations
decorator pattern
decrement
default
deleting sessions
deploy web app
deployment
deployment descriptor
deployment descriptor contents
deployment of web application
deserialization
deserialize
design pattern
design pattern interview questions
design patterns
Designpatterns
destory method
destroy
destroying sessions
determining current thread
determining the current thread
Developer
Differences
different types of collections
display stuff in a frame
displaying images
displaying images in java swings
displaying images in swings
displaying text in a component
division
do while loop
doget
dohead
dopost
doput
DOS
Downloads
drawing a line
drawing an ellipse
drawing circles
drawing ellipses
drawing lines
Drools tutorial
eBooks
Eclipse
Eclipse Tutorial
Encapsulation
encapsulation in java
enhanced for loop
entity facade pattern
enumerations
enumerations in java
enums
equal to
equals
equals comparison
error and exception
error codes
error handling in servlets
error page
event handling in swings
event listeners
exam prep tips
example servlet
Examples
exception
exception handling
exception handling in servlets
exception handling interview questions
exception handling questions
Exceptions
exceptions in java
exceptions in web applications
explicit locking
explicit locking of objects
file
file navigation
filereader
filewriter
final class
final method
FireBug
first servlet
FIX protocol
FIX Protocol interview questions
FIX protocol tutorial
font
fonts
for each loop
for loop
form parameters
form values
formatting
forwarding requests
frame
frame creation
frame positioning
frame swings
front controller
front controller design pattern
front controller pattern
fundamental.Java
FXML
Games
garbage collection
garbage collection interview questions
garbage collection questions
garbage collector
gc
gc questions
general
generic
Generics
generics collections
Geo
get
get set methods
getattribute
getting bean property
getting form values
getting form values in servlet
getting scwcd certified
getting servlet initialization parameters
getting sun certified
Google
Graphics2D
gregorian calendar
handling strings in java
hash
hash map
hash table
hashcode
hashmap
hashset
hashtable
head
head request
HeadFirst
heap
heaps
hibernate
hibernate interview questions
hibernate interview questions and answers
hibernate questions
hibernate questions and answers
Hibernate Tutorial
HibernateBooks
homework
How To
HTML
HTML and JavaScript
html form
http request
http request handling
http request header
http request methods
http request servlet
http request type
http session
httprequest
httprequest methods
httpservlet
httpservlet interview questions
httpservlet interview questions with answers
httpsession
httpsession interview questions
httpsession questions
HttpSessionActivationListener
HttpSessionAttributeListener
HttpSessionBindingListener
if
if else
if else block
if else statement
Image IO
implementing an interface
Implicit objects
increment
info
inheritance
inheritance in java
init
init method
Initialization Blocks
inner class
inner class inside a method
inner classes
innerclass
installation
instanceof
instanceof operator
IntelliJ
interaction between threads
interface
interface interview
interface questions
interfaces
interfaces in java
interfaces interview questions
internet history
interrupting a thread
interrupting threads
Interview
interview questions
interview questions on design patterns
interview questions on exception handling
interview questions on java collections
interview questions on serialization
introduction to java threads
introduction to jsps
introduction to threading
introduction to threads
invalidating session
Investment Banking
IO Package
iscurrentthread
iterator
J2EE
j2ee api
j2ee design pattern
j2ee design pattern interview questions
j2ee design patterns
j2ee hibernate interview questions
j2ee history
j2ee interview
j2ee interview questions
j2ee mvc
j2ee mvc pattern
j2ee programmer
j2ee questions
j2ee servlet api
j2ee session
j2ee struts interview questions
java
java 5 tutorial
Java 8
java arrays
java assertions
java assignments
java awt questions
java bean
java bean scope
java beans
java beginners tutorial
Java career
java certification
Java Class
java collection interview questions and answers
java collection tutorial
java collections
java collections interview questions
java constructors
java currency
Java CV
java data base connectivity
java database connectivity
java database connectivity interview questions and answers
java dates
java design pattern
java design patterns
java developer certification
Java EE
java encapsulation
java enums
java event listeners
java exceptions
java formatting
java garbage collection
java garbage collector
java gc
java heap
Java I/O
java inheritance
java input output
Java Interface
Java Interview
Java Interview Answers
Java Interview Questions
Java Introduction
java io
java IO tutorial
java iterator
java jdbc
Java JSON tutorial
Java Key Areas
java lists
java literals
java locks nested
Java Media Framework
java methods
java multithreading
Java multithreading Tutorials
java nested locks
java networking tutorial
java numbers
Java Objects
java operators
java overloading
java parsing
Java Programming Tutorials
java race conditions
java regex
java regular expressions
Java resume
java scjp
java searching
java serialization
java server pages
java server pages api
java server pages questions
java spring interview questions. j2ee spring interview questions
java stack
java strings
java swing
java swing event listeners
java swing frame
java swing images
java swings
java swings images
java thread explicit locking
java thread lock scope
java thread locking
java thread locking mechanism
java thread locking objects
java threads
java threads race condition
java tips
java tokenizing
Java Tools
Java Tutorial
java ui questions
Java Utilities
java variables
java wrappers
Java xml tutorial
java.lang
java8
javabean
javabean accessing
javabean scope
JavaBeans
javac
JavaEE
JavaFX
JavaFX 3D
JavaFX 8
JavaOne
JavaScript
JavaTips
JDBC
jdbc driver
jdbc example
jdbc interview questions
jdbc interview questions and answers
jdbc interview questions with answers
jdbc sample code
JDBC Tutorial
jdbc type 1 driver
jdbc type 2 driver
jdbc type 3 driver
jdbc type 4 driver
Jdeveloper
JDK
JDK8
JEE Tutorial
jframe
jframe creation
jframe position
jframe positioning
JIRA
JMeter
JMS
JMX
join()
joining threads
JPA
JQuery
JS
JSF
JSF Tutorial
JSONP
JSP
jsp and java beans
jsp and servlets
jsp and xml
jsp api
jsp code
jsp compilation
jsp conversion
jsp directives
jsp error page
jsp error page directive
jsp implicit objects
jsp interview
jsp interview questions
jsp introduction
jsp intvw questions
jsp life
jsp life cycle
jsp life-cycle
jsp lifecycle
jsp page directive
jsp questions
jsp sample
jsp scripting
jsp scriptlets
jsp servlets
jsp summary
jsp synopsis
jsp tag libraries
jsp tag library
jsp taglib
jsp tags
jsp technology
jsp to servlet
jsp to servlet conversion
jsp translation
jsp usage
jsp usebean
jsp xml tags
jsp xml tags usage
jsp-servlet
jsp:getProperty
jsp:setProperty
jsp:usebean
jsps
JSTL
JUnit testing
keyword synchronized
keyword volatile
Keywords
Lambda Expressions
Learning
libraries
life cycle
life cycle of a jsp
life cycle of a servlet
life cycle of a thread
life cycle of jsp
life cycle of threads
lifecycle of a thread
linked list
linkedhashmap
linkedhashset
linkedlist
linux
List
listeners
lists
Literals
locale
lock manager pattern
lock scope
locking objects using threads
log
Logging
logging errors
logical and
logical operators
logical or
loops
loosely coupled
making an arraylist
making threads sleep
making threads sleep for time
MapReduce
maps
maps usage
Maven
Maven Tutorial
max priority
member access
method arguments
method local inner class
method overloading
method overriding
method return types
methods creating classes
min priority
Miscellaneous
mobile
mock exam
model view controller
model view controller design pattern
model view controller pattern
Multi Threading
Multi-threading
multiple threads
multiplication
multithreading
multithreading in java
multithreading interview questions
multithreading questions
mvc
mvc design pattern
mvc pattern
MyEclipse
mysql
nested java lock
nested java locks
nested java thread locks
nested locks
nested thread locks
NetBeans
Networking
new
news
nio
NonAccess Modifiers
norm priority
normal inner class
Normalization
not equal to
Notepad
notify
notifyall
number format
numberformat
numbers
object comparison
object notify
object orientation
object oriented
object oriented programming
Object Oriented Programming in java
objects interview questions
ocmjd certification
ocmjd certification eligibility
OO
OO Java
oops
OpenCSV
OpenCV
opening jsp tags
OpenJDK
OpenJFX
Operators
or
Oracle
Oracle ADF Mobile
Oracle Certified Exams
oracle certified master java developer
oracle database
ORM
other topics
out
overloading
overloading constructors
overloading in java
overriding
page
page directive
page scope
parsing
passing variables
passing variables to methods
performance
Platform
Playing with Numbers
points to remember
polymorphism
positioning a frame
post
practice exam
Primitive Casting
primitive variables
printwriter
priority queue
priority queues
priorityqueue
priorityqueues
private
processing form values
Products
programming
Projects
protected
public
put
questions
questions on garbage collection
questions on java strings
queue
quick recap
quick review
race conditions
read objects from stream
reading http request header
RealTime_Tips
redirecting to another servlet
redirection
reference
reference variable casting
reference variables
Refreshing Java
regex
Regular Expressions
regular inner class
relational operators
reminder
request
request dispatcher
request forwarding
request header
request object. httpservletrequest
request scope
requestdispatcher
response
RESTClient
RESTful
retrieving values from session
return error codes
return types
returning values
runnable
runnable interface
running
running java programs
RUP
sample jsp
sample questions
sample questions scwcd
sample servlet
scanner
Scene Builder
scjd certification
scjd certification eligibility requirements
scjp
SCJP Certification
scjp exam
scjp exam questions
scjp exam sample questions
scjp questions
scjp test
scjp test questions
scope
scope of java locks
scope of java thread locks
scope of locks
scripting in jsp
scriptlet tags
scriptlets
scriptlets in jsp pages
scwcd
scwcd certification
scwcd certification practice exam
scwcd exam
scwcd exam questions
scwcd jsp summary
scwcd mock exam
scwcd mock exam answers
scwcd practice exam
scwcd practice test
scwcd questions
scwcd test
SDLC
searching
searching arrays
searching collections
searching in java
searching treemap
searching treesets
security
self assement
self assement scwcd
self assessment scjp
self test
self test scjp
self test scwcd
send error method
senderror method
sending error code to browser
serialization
serialization in java
serialization interview questions
Serialization on Swing
serialization questions
service
service method
servlet
servlet and forms
servlet and jsp
servlet api
servlet attributes
servlet code
servlet container
servlet context
servlet error handling
servlet exception handling
servlet handling http request
servlet initialization
servlet initialization parameters
servlet interview
servlet interview questions
servlet interview questions with answers
servlet intvw questions
servlet life cycle
servlet lifecycle
servlet questions
servlet questions with answers
servlet request
servlet request dispatcher
servlet request type
servlet skeleton
servletcontext
servletcontextevent
servletrequest
Servlets
servlets and jsps
servlets api
servlets details
servlets request handling
session
session clean up
session event listeners
session facade pattern
session interview questions
session invalidation
session listeners
session management
session questions
session scope
session timeout
session tracking through url rewriting
set collections
set status method
setattribute
sets
setstatus method
setting bean property
setting request type
short circuit operators
Singleton
sleep
sleeping threads
soapUI
Software Installation
sorting
sorting arraylist
sorting arrays
sorting collections
special collections
special inner classes
split
spring
spring and hibernate interview questions
spring batch
Spring Core
Spring Framework
Spring Integration
spring interview questions
Spring JDBC
Spring MVC
Spring security
Spring tutorial
SQL
SQL and database tutorial examples
SQL Tutorial
SSL
stack
stacks
stacks and heaps
static
static class
static declaration
static imports
static inner
static inner class
static method
Static variable
stopped
stopping a thread
stopping thread
stopping threads
Stored Procedure
storing values in session
Streams
strictfp
StrictMath
string
string buffer
string builder
string class
string formatting
String Handling
string interview questions
string manupulation
string questions
string tokenizer
stringbuffer
stringbuffer questions
stringbuilder
Strings
strings in java
struts
Struts 1
Struts 1.2
Struts 2
struts framework interview questions
struts interview questions
struts interview questions with answers
struts mvc interview questions
struts questions
Struts2
StrutsBooks
submitting request
subtraction
Sun Certification
sun certified java developer
Sun Certified Java Programmer
swing
swing action performed
swing and colors
Swing Components
swing event handling
swing event listeners
swing events
Swing Hacks
swing images
Swing Look And Feels
swings
swings frame
switch block
switch case block
switch case statement
Sybase
Sybase and SQL Server
synchronization
synchronized code
synchronized keyword
synchronized method
System Properties
tag lib
tag library
tag-lib
taglibs
tags
TDD
Technical Blogging
ternary operator
Test Driven Development
test scjp
Testing
the context
the session
the volatile keyword
thread
thread class
thread deadlocks
thread interaction
thread interruption
thread life cycle
thread lifecycle
thread lock scope
thread locks
thread notify
thread priorities
thread race conditions race conditions in threads
thread sleep
thread states
thread stoppage
thread stopping
thread synchronization
thread syncing
thread yield
Threads
threads in java
threads interview questions
threads life cycle
threads questions
tibco
tightly coupled
tips
tips and tricks
tips.FXML
tokenizing
Tomcat
Tools
toString
transitions
treemap
treeset
tricks
Tricks Bag
try catch
try catch finally. finally block
Tutorial
type casting in java
ui programming with java swings
UML
unboxing
unit testing
unix
url rewriting
use bean
usebean
using a arraylist
using collections
using colors
using colours
using command line arguments
using different fonts
using expressions
using font
using fonts
using fonts in swings
using hashmap
using http session
using httpsession
using iterator
using java beans in jsp
using javabean in jsp
using javabeans in jsp
using javac
using lists
using maps
using request dispatcher
using scriptlets
using session persistense
using sets
using special fonts
using system properties
using the jsp use bean
using treeset
using use bean
Using Variables
using volatile
Using Wrappers
using xml in jsp
Util pack
value object
value object design pattern
value object pattern
var-args
varargs
Variable Arguments
Variables
vector
vector questions
vectors
visibility
vo pattern
volatile
volatile keyword
volatile variables
wait method
waiting
web app exception handling
web app interview
web application deployment
web application exceptions
web application scope
web application security
web component developer
web component developer certification
web context
web context interfaces
web context listeners
web interview questions
web security
web server
web servers
Web services
web.xml
web.xml deployment
webapp log
weblogic
website hacking
website security
what are threads
what is a java thread
what is a thread
what is thread
while loop
windows
windows 8
wrapper classes
wrappers
write objects to stream
WSAD
xml
xml and jsp
xml tags
xslt
yield()