and even look for patterns within lines while doing so the methods for processing input in this way include the followinghasnextline()returns true if and only if the input stream has another line of text nextline()advances the input past the current line ending and returns the input that was skipped findinline(string )attempts to find string matching the (regular expressionpattern in the current line if the pattern is foundit is returned and the scanner advances to the first character after this match if the pattern is not foundthe scanner returns null and doesn' advance these methods can be used with those aboveas wellas in the followingscanner input new scanner(system in)system out print("please enter an integer")while (!input hasnextint()input nextline()system out print("thats not an integerplease enter an integer")int input nextint() an example program in this sectionwe describe simple example java program that illustrates many of the constructs defined above our example consists of two classesonecreditcardthat defines credit card objectsand anothertestthat tests the functionality of creditcard class the credit card objects defined by the creditcard class are simplified versions of traditional credit cards they have identifying numbersidentifying information about their owners and their issuing bankand information about their current balance and credit limit they do not charge interest or late paymentshoweverbut they do restrict charges that would cause card' balance to go over its spending limit the creditcard class