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  w  w. j  a  v  a  2 s. c om

    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