Back to Checkstyle

CodeConventions.Doc10

src/site/resources/styleguides/sun-code-conventions-19990420/CodeConventions.doc10.html

latest2.2 KB
Original Source

[Contents] [Prev]


11 - Code Examples

11.1 Java Source File Example

The following example shows how to format a Java source file containing a single public class. Interfaces are formatted similarly. For more information, see "Class and Interface Declarations" on page 4 and "Documentation Comments" on page 9

/*
* @(#)Blah.java 1.82 99/03/18
*
* Copyright (c) 1994-1999 Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
* All rights reserved.
*
* This software is the confidential and proprietary information of Sun
* Microsystems, Inc. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Sun.
*/

package java.blah;

import java.blah.blahdy.BlahBlah;

/**
*_Class description goes here_.
*
* @version_1.82 18 Mar 1999_ * @author_Firstname Lastname_ */
public class Blah extends SomeClass { _/\* A class implementation comment can go here. \*/_ /**_classVar1 documentation comment_*/
public static int classVar1;

/***_classVar2 documentation comment that happens to be_ *_more than one line long_ */
private static Object classVar2;

/**_instanceVar1 documentation comment_*/
public Object instanceVar1;

/**_instanceVar2 documentation comment_*/
protected int instanceVar2;

/**_instanceVar3 documentation comment_*/
private Object[] instanceVar3;

/** 
* ..._constructor Blah documentation comment..._ */
public Blah() { _// ...implementation goes here..._ }

/**
* ..._method doSomething documentation comment..._ */
public void doSomething() { _// ...implementation goes here..._ }

/**
* ...method doSomethingElse_documentation comment..._ * @param someParam_description_ */
public void doSomethingElse(Object someParam) { _// ...implementation goes here..._ }
}

[Contents] [Prev]


Copyright © 1995-1999, Sun Microsystems, Inc. All rights reserved.