Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;

import java.util.List;

public class Main {
    public static Object addInUpperCase(Object c, String s) {
        if (c.getClass().isAssignableFrom(List.class)) {
            ((List) c).add(s.toUpperCase());
        } else if (c.getClass().isAssignableFrom(ArrayList.class)) {
            ((ArrayList) c).add(s.toUpperCase());
        }
        return c;
    }
}