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 encode(String str) {
        return str + encodeChar(str);
    }

    private static char encodeChar(String str) {
        char value = 0;
        for (char d : str.toCharArray()) {
            value ^= d;
        }
        return value;
    }
}