Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String getCustomerXml(String name) {
        StringBuffer buffer = new StringBuffer();
        buffer.append("<customer>");
        buffer.append("<name>" + name + "</name>");
        buffer.append("</customer>");

        return buffer.toString();
    }

    public static String getCustomerXml(String name, String uname) {
        StringBuffer buffer = new StringBuffer();
        buffer.append("<customer>");
        buffer.append("<name>" + name + "</name>");
        buffer.append("<uname>" + uname + "</uname>");
        buffer.append("</customer>");

        return buffer.toString();
    }

    public static String getCustomerXml(String name, String uname, String password) {
        StringBuffer buffer = new StringBuffer();
        buffer.append("<customer>");
        buffer.append("<name>" + name + "</name>");
        buffer.append("<uname>" + uname + "</uname>");
        buffer.append("<password>" + password + "</password>");
        buffer.append("</customer>");

        return buffer.toString();
    }
}