Showing posts with label JAVA Example. Show all posts
Showing posts with label JAVA Example. Show all posts

Friday, 2 December 2011

Templating with JSF 2.0 Facelets

Learn how to develop a Facelets Web application in Oracle Enterprise Pack for Eclipse 11g and deploy the application to Oracle WebLogic Server 11g. In JavaServer Faces (JSF) 2.0, Facelets is the default view declaration language (VDL) instead of JavaServer Pages (JSP). With Facelets, you don’t need to configure a view handler as you used to do in JSF 1.2. Facelets is a JSF-centric view technology.

more

Monday, 21 November 2011

JAVA comprehensive example

// OddEven.java
import javax.swing.JOptionPane;

public class OddEven {
    // "input" is the number that the user gives to the computer
    private int input; // a whole number("int" means integer)

    /*
     * This is the constructor method. It gets called when an object of the OddEven type
     * is being created.
     */
    public OddEven() {
    /*
     * In most Java programs constructors can initialize objects with default values, or create
     * other objects that this object might use to perform its functions. In some Java programs, the
     * constructor may simply be an empty function if nothing needs to be initialized prior to the
     * functioning of the object.  In this program's case, an empty constructor would suffice, even if
     * it is empty. A constructor must exist, however if the user doesn't put one in then the compiler
     * will create an empty one.
     */
    }

    // This is the main method. It gets called when this class is run through a Java interpreter.
    public static void main(String[] args) {
        /*
         * This line of code creates a new instance of this class called "number" (also known as an
         * Object) and initializes it by calling the constructor.  The next line of code calls
         * the "showDialog()" method, which brings up a prompt to ask you for a number
         */
        OddEven number = new OddEven();
        number.showDialog();
    }

more

JAVA Hello World Example

Hello world
The traditional Hello world program can be written in Java as:[34]
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}



more

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More