Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String getFullName(String firstName, String lastName) {
        StringBuffer result = new StringBuffer();
        boolean flag = false;
        if (lastName != null && !lastName.isEmpty()) {
            result.append(lastName);
            flag = true;
        }
        if (firstName != null && !firstName.isEmpty()) {
            if (flag) {
                result.append(", ");
            }
            result.append(firstName);
        }

        return result.toString();
    }
}