Category: Java Short Notes

Java Short Notes, java ee short notes, J2ee Short Notes

Jun 23

Set, TreeSet, Iterator in Java

/* * * *Illustrates mathematical set operations * * Created on January 10, 2008, 9:28 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package treesetexample;import java.util.Set;import java.util.TreeSet;import java.util.Iterator;/** * * @author Sayed */public class TreeSetExample { /** Creates a new instance of …

Continue reading

Jun 11

JAVA: Some links: useful for exams like scjp/scja

Assertions in Java: Enum in Java: and StringBuilder Classes have similar methods where StringBuffer is synchronized: and Deserialize: package is very important:

Jun 05

SCJP: Classpath and Jar

Java certification exams like SCJP test your knowledge about java classpath. Check here for an excellent resource on the topic . System classpath We can specify classpath in the command line or make use of a `system’ class path. The IDEs have their own way of maintaining class paths. System class paths will be used …

Continue reading

Apr 10

JSP: Reference Manuals

JSP Syntax : Quick Reference JSP Syntax : Quick Reference – 2 JSP tutorial by Sun: Reference

Apr 09

Java Bean : Basic Idea

What is Java bean?Just a component technology. You can create platform independent components using Java beans. Key Bean Concepts:1. introspection: Through introspection beans expose their properties, methods, and events. Beans support introspection in two ways: 1.1: Design patterns: The Introspector class examines beans for design patterns to discover bean features 1.2: Through a related bean …

Continue reading

Apr 04

Linked List and Iterator in Java

/* * * * Created on January 10, 2008, 8:51 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package linkedlist;import java.util.List;import java.util.LinkedList;import java.util.Iterator;import java.util.ListIterator;import java.util.Collections;import java.util.Random;/** * * @author Sayed */public class LinkedListTest { /** Creates a new instance of LinkedList */ …

Continue reading

Mar 27

Java: Struts: Lesson 5: Processing Requests with Action Objects

Corresponding Video TutorialCode Example for this article What happens? When a form is submitted? Flow: Refer to a from form action Check struts-config.xml for action named ‘x’ Check the corresponding type (class) of the action, execute the execute method of that action type (really a class where execute is the class method) The method …

Continue reading

Mar 23

SCEA:Security in Java: Potential threats to a system and how to address the threats:Java Enterprise Architect

Input Validation Failures: Input should be validated both at the client end and the server end (before any processing). Validating both from trusted and untrusted sources is important. Otherwise code injection attack may happen. Validation should include: data type (string, integer), format, length, range, null-value handling, verifying for character-set, locale, patterns, context, legal values and …

Continue reading

Mar 18

Java File Operation Example

Code that helped me to create – the Bangladesh section based on the the web-site package hello;import javax.swing.JOptionPane;import java.util.ArrayList;import java.util.Iterator;import*;/** * Created by IntelliJ IDEA. * User: Sayed Ahmed * Date: May 30, 2008 * Time: 9:45:08 PM * To change this template use File | Settings | File Templates. *//**Class containing …

Continue reading

Dec 29

SCJP: Java Operators

Exams like SCJP test your understanding of Java operators and how to use them like: assignment operators: =, +=, -=arithmetic operators: +, -, *, /, %, ++, –relational operators: < , , >=, ==, !=logical operators: &, |, ^, !, &&, ||conditional operators: ? : Also operators to check the equality of two objects or …

Continue reading

Dec 07

SCJP: Random Stuffs

An enum may NOT be declared in a method An enum can be imported If the JVM has a choice, it will select a method without varargs before selecting a method with varargs When enums are equal, both .equals and == always return true The headMap() method returns the portion of the map whose keys …

Continue reading

Dec 06

Creating Java Development Environment with Struts for Your Home PC

Creating Java Development Environment with Struts for Your Home PC…………………….. Why Struts? Just take a look at the web-sites using Struts J2EE does not meet all the requirements for web-applications. Struts addresses these requirements. Check this article for details Components Required J2SE 5/6 or J2EE 5 – both JRE and JDK Tomcat 5.5/6 – web-server …

Continue reading

Nov 26

EJB Overview: EJB in a nutshell

Objects provide encapsulation/re-usability at the class level. A component can be comprised of multiple objects Component = logical groups of classes = distributed objects = business objects A component can be developed to address a specific enterprise applications. Hence, components can provide significant encapsulation/re-usability in the partitioned enterprise problems. Component model = components + their …

Continue reading

Oct 30

JSF: Lesson – 1: JSF Specifications

Video Demonstration of a sample JSF application create: Read the article first JSF Specifications JSF is not standalone technology, you have to use it in conjunction with JSPs, Servlets, EJBs How to use JSF with Servlets and EJBs: In Servlet or EJB, explicitly create instances of UI components and use the UI classes directly JSF …

Continue reading

Oct 30

Core J2EE Component Technologies

Core J2EE Component Technologies J2EE Application Components: Web Components, Business Components Web-Component: Software entity hosted by a web-container on a J2EE Server Generate user interface for web-based applications Two Types: Servlets, JSPs Servlets: Process requests dynamically, format responses JSPs: How to process requests, and format responses Business Components: EJB Components or enterprise beans: Contain business …

Continue reading

Oct 24

SCJP: Basic Java I/O

ByteStream is the basic I/O stream. Handles data as a stream of bytes. Does operation with byte unit and uses 8 bit. FileInputStream, FileOutputStream – can be used to copy files as byte by byte. Character Streams: FileReader and FileWriter are character streams. They treat file data as 16 bit unicode charater streams. InputStreamReader, OutputStreamWriter …

Continue reading

Oct 10

Video Tutorials on Different Java technologies

The following video tutorials contains videos on Basic and Advanced Servlet and JSP Development Understanding and Developing EJBs Portal Development and Administration WebSphere Application Server Administration Struts Development with WSAD 5.1 Video Tutorials JSPs with IRAD The HttpSession Creating JavaBeans Testing with JUnit Advanced Web Coding JSPs with jsp:usebean Obtaining User Input Creating Custom Tags …

Continue reading

Sep 30

Lesson 1: Just Step by Step Hibernate

Hibernate Documentation for First Timers

Sep 13

SCJP: Class Declarations

class declarations Start with modifiers such as public, private followed by class keyword The class name, with the initial letter capitalized The name of the class’s parent (superclass), preceded by the keyword extends (if any). A class can only extend (subclass) one parent. list of interfaces implemented by the class, preceded by the keyword implements …

Continue reading

Sep 11

Java Collections Framework

Some URLs Vs. ArrayList Vector vs. Hashtable ArrayList vs. LinkedList

Sep 01

Code Conventions for the Java Programming Language

Why Have Code Conventions? 80% of software life cycle is spent on software maintenance. Hardly the original author maintains a software Code Conventions improve the readability of the software If you require to ship your source code as a product, code conventions make your product well packaged Java Code Conventions Avoid assigning several variables to …

Continue reading

Aug 13

Spring and iBatis: Some Notes [Will be updated later]

Implementing the data access layer of a Spring application using iBATIS. Spring Framework and IBATIS You can use JDBC with Spring for sure. Spring also simplifies the use of JDBC. iBATIS can provide one more step in simplification. Using iBATIS, you can mapdata and Java objects, also make use of simplified database operations. Using iBatis …

Continue reading

Aug 07

JSF: Lesson – 3: Controlling Page Navigation in JSF

Sample application for this article Video Tutorial for this article Pre-requisite: JSF Lesson 1 & 2 Navigation: Two Types: Static: The destination page is fixed Dynamic: The destination page varies with the conditions Static Static: You provide a fixed value for the “action” attribute for a JSF event control/action element That fixed value is mapped …

Continue reading

Jul 21

SCJP Training: Lesson 6: Collections / Generics

Object Ordering Object as a Superclass Generic Types Declaring Classes Defining an Interface Passing Information to a Method or Constructor Returning a Value from a Method Generic Types Generic Methods and Constructors Wildcards Algorithms

Jul 20

Starting Mobile Application Development with J2ME

please check: Download: Overview: Getting Started:

Jul 15

Java: Collections Frameworks

Core collection interfaces: Collection (Set(SortedSet), List, Queue), Map(SortedMap) A Map is not a true Collection. public interface Collection extends Iterable { // Basic operations int size(); boolean isEmpty(); boolean contains(Object element); boolean add(E element); //optional boolean remove(Object element); //optional Iterator iterator(); // Bulk operations boolean containsAll(Collection< ?> c); boolean addAll(Collection< ? extends E> c); //optional …

Continue reading

Jul 04

Introduction to Service Oriented Architecture

Check the following videos and lecture notes. We will create our own videos in near future. SOA Overview Lecture Notes on SOA in J2EE Platform

Jun 10

SCJP Training: Lesson 1: Develop code that declares classes (including abstract and all forms of nested classes), interfaces, and enums, and includes the appropriate use of package and import statements (including static imports).

Declaring Classes Abstract Methods and Classes Nested Classes Interfaces Enum Types Creating and Using Packages Using Package Members (import statements, static imports) Defining an Interface Implementing an Interface Abstract Methods and Classes Primitive Data Types Arrays Enum Types Understanding Instance and Class Members Variables Declaring Member Variables Understanding Instance and Class Members Passing Information to …

Continue reading

May 25

JSF: Lesson – 6: Validating User Input in JSF

Target: Intermediate level web-developers. Sample application for this article Video Tutorial for this article In web-application development, validating user inputs takes much efforts. JSF has made validations much easier than usual JSF Built-in Validators: validateDoubleRange: Checks that the value provided is a double value. You can also set a minimum and a maximum. validateLongRange: Validates …

Continue reading

May 19

Topics to Learn in Java Spring framework

Why Spring Framework? What’s wrong with Java EE (EJB) Light-weight vs. heavy-weight containers Motivation for Spring Spring Background Spring Framework Overview Spring features Spring light-weight container architecture Spring application context Inversion of Control (IoC) design pattern Dependency Injection (DI) Advantages of IoC/DI Design for testability Low coupling Code re-use Consistent architecture and configuration Easy-to-follow design …

Continue reading

Skip to toolbar