Powered by Blogger.

Download Object Oriented Programming with Java eBook

>> Saturday, January 28, 2012


Object Oriented Programming with Java eBook_JavabynataraJ
An Introduction to Object-Oriented Programming with Java takes a full-immersion approach to object-oriented programming. Proper object-oriented design practices are emphasized throughout the book. Students learn how to use the standard classes first, then learn to design their own classes.

Wu uses a gentler approach to teaching students how to design their own classes, separating the coverage into two chapters. GUI coverage is also located independently in the back of the book and can be covered if desired.

Wu also features a robust set of instructors' materials including PowerPoint slides, code samples, and quiz questions.

Read more..

Static ContextPath to Dynamic ContextPaths in Jsp and JS pages.

>> Thursday, January 26, 2012

Changing Static ContextPath to Dynamic ContextPath references in JSP and JS pages in our project. If you are working with any project on java and jsp technologies, if the requirement may come to change the static context paths to dynamic context path.

What is the need to change context path from static to dynamic context path?

While developing our application we use to develop to put our contextPath directly in some areas like for links and mostly for images we give absolute paths with context. We put this in developing the project. After developing the project , it goes to Testing after then to production.
Let us assume our project contextPath is "/myproj"

Read more..

Understanding foreach loop in Java

>> Sunday, January 8, 2012


To make iteration over arrays and other collections more convenient Java5 extended the basic for loop and it is named as for-each Loop and also called as enhanced for loop or foreach loop.

The for-each loop is used to access each successive value in a collection of values.

This foreach loop is commonly used to iterate over an array or a Collections class (eg, ArrayList).

Read more..

Basic Struts Login Application

>> Sunday, December 18, 2011

 This is our first Application on Struts for Beginners. Before going to start our application go through the Struts flow and architecture.

These are the required files to Develop Struts Login Application:
  1. register.jsp
  2. success.jsp
  3. failure.jsp
  4. RegisterAction.java
  5. RegisterForm.java
  6. struts-html.tld
  7. web.xml
  8. struts-config.xml
Project Structure:
Basic Struts Login Application Project Structure

Create the jsp files first what you want to display as a home page and resultant pages.

Read more..

Prime Number Logic

>> Sunday, December 11, 2011

The Prime Number program logic is simple but some times we can't catch immediately. In many interviews candidates will discuss each other about this logic. Here given as simply to understand the main logic.

In this program we use two 'for' loop. For loop will start from 1 to entered number. And another loop will start and divide it from 2 to less than those number. If number is divided by any number that means it is not prime otherwise prime number.

In this first for look the values repeat up to the given number 'num'. After it check the prime number logic.
The program given below.

Read more..

How does the ternary Operator Works?

>> Tuesday, November 15, 2011

The Ternary Operator contains three operands with
  "? :". Based on the return type it will give the value.

operand1 ? operand2 : operand3

Ternary Operator Syntax:

boolean expression ? value1 : value2 ;

The first operand is a boolean expression; if the expression is true then the value of the second operand is returned otherwise the value of the third operand is returned:

Here if operand1 is true, operand2 is returned.

operand1 must be a boolean type

Read more..

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2022. All rights reserved.