java - Figure out Odd Even or Zero by entering the value -



java - Figure out Odd Even or Zero by entering the value -

my teacher asked me question , confused how write out code. understood had do, couldn't write in java. question that: design , implement application determines , prints number of odd , 0 digits. input user/keyboard. don't know how start. can help me here reply , explanation that?(without using string) give thanks much time.

application? it's 3 lines:

int odds = str.replaceall("[^13579]", "").length(); int evens = str.replaceall("[^2468]", "").length(); int zeroes = str.replaceall("[^0]", "").length();

if input not string, create one:

long number; string str = number + "";

java

Comments

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -