Friday, October 15, 2004

my Java Bible

"Simplicity makes things perfect" thts the phrase to describe 'javaranch'.
To me, as a developer its not less than a bible.

Java Coding Template

/* Java Coding Template */

/*
<>
* File: ClassName.java
* Date Author Changes/Summary
* Sep 01 04 Ajit Created
* Sep 13 04 Nav Added new method
*
* Copyright (c) : Company Information & Copyright Policy
*/


package demo.com; <>
<>
import java.util.NoSuchElementException;
<>

/**
* <>
* A class representing a window on the screen.
* <>
* <>
* @see java.util.NoSuchElementException
* @version 1.2 18 Sep 2004
* @author Ajit, Nav

*/ <>
class ClassName extends SuperClass {
<> <>
/** <>
* The current number of elements.
* must be non-negative, and less than or equal to capacity.

*/ <>
protected int count;
<> variables/functions remains the same>
/** <>
*
* better to have a break down of logiccal implemention>
* <>
* @since API Specification/ Reference
* @param p1 description of parameter p1
* @param p2 description of parameter p2
* < @return must be there, even if its returning void >
* @return return_type description
* @throws Exception1 probable reason for the exception1
* @throws Exception2 probable reason for the exception2
*
*/ <>
public int method1(Object element){
<>
/*
* <>
*/
while ( i <100){ style="color: rgb(102, 0, 204);"><>

/**
*
* better to have a break down of logic implemention>
* <>
* @since API Specification
* @param p1 description of parameter p1 here
* @param p2 description of parameter p2 here
* < @return must be there, even if its returning void >
* @return return_type description of the value returned by this method here
* @throws Exception1 probable reason for the exception1
* @throws Exception2 probable reason for the exception2
*
*/ <>
public int method2(Object element){

……implementation

}

} // end of class


link for Javadoc comments