public static void main(String[] args) {
        try {
            Twitter twitter = new TwitterFactory().getInstance();
            User user = twitter.verifyCredentials();
            System.out.println("Successfully verified credentials of " + user.getScreenName());
            System.exit(0);
        } catch (TwitterException te) {
            te.printStackTrace();
            System.out.println("Failed to verify credentials: " + te.getMessage());
            System.exit(-1);
        }
    }
public static void main ( String [ ] args ) { try { Twitter twitter = new TwitterFactory ( ) . getInstance ( ) ; User user = twitter . verifyCredentials ( ) ; System . out . println ( "Successfully verified credentials of " + user . getScreenName ( ) ) ; System . exit ( 0 ) ; } catch ( TwitterException te ) { te . printStackTrace ( ) ; System . out . println ( "Failed to verify credentials: " + te . getMessage ( ) ) ; System . exit ( - 1 ) ; } }
Usage: java twitter4j.examples.account.VerifyCredentials

@param args message