Java - Write code to check if Object Is Bank

Requirements

Write code to check if Object Is Bank

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        Object obj = "book2s.com";
        System.out.println(checkObjectIsBank(obj));
    }/*from   w ww  .  java 2s .  co m*/

    public static boolean checkObjectIsBank(Object obj) {
        try {
            if (obj == null || obj.toString().trim().equals("")) {
                return true;
            } else {
                return false;
            }
        } catch (Exception e) {
            return true;
        }

    }
}

Related Exercise