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 toXml(String fieldName, String fieldValue) {
        StringBuffer xmlBuf = new StringBuffer();
        xmlBuf.append(startTag(fieldName));
        xmlBuf.append(fieldValue);
        xmlBuf.append(endTag(fieldName));
        return xmlBuf.toString();
    }

    public static String startTag(String tagData) {
        return "<" + tagData + ">";
    }

    public static String endTag(String tagData) {
        return "</" + tagData + ">";
    }
}