Hi all,
Just doing a little reviewing for finals in my CS class and I'm having a little trouble.
Here's the problem: Implement a method named isBig that will accept one string parameter named alpha. It will return true only if the length of the string is greater than 6.
Here's my answer:
Here is the method:
Code:
public boolean isBig(String alpha)
{
if (alpha.length() > 6)
return true;
else
return false;
} Here is it running in main:
Code:
String alpha;
System.out.println("Enter a string: ");
alpha = scan.nextLine();
System.out.println(ob1.isBig(alpha)); And here is the output:
So I can't figure out why it isn't letting me input a String and just skipping right to the method part. It's probably something really simple and it's just going over my head. Any help is appreciated. Thanks
Curtis