00:01
All right, let's build a java program that will tell us whether or not a string is a palindrum or not.
00:10
And so let's go ahead and try this.
00:17
So you want to input a word or phrase and say whether or not that input is a palindrome.
00:23
So let's go ahead and do that.
00:24
So to get input from the user, we need to get import java util scanner.
00:30
And then we want to create a scanner object.
00:32
So let's make scanner a scanner.
00:34
Is a new scanner object with the argument is just system.
00:42
That in to show that we want to do inputs.
00:46
And what we want to do is we want to get our input is just equal to scanner.
00:54
Next.
00:57
And so what this is going to do is going to allow us, let's make this a string.
01:00
So we're going to make this a string input is this is scanner.
01:03
And not next.
01:04
And what this is going to do is grab the next string that's written by the user.
01:08
And we're going to do some manipulations with this.
01:12
So, in order to tell us whether this is a palindrome, we want to check the reverse and the reverse string against the forward string.
01:23
And if they're equal, then we can go ahead and print whether or not there's a palindrome or not.
01:33
So we can do a forward loop.
01:36
Let's let this integer l is equal to the length or input that length.
01:46
And we're only working with single words here because that's what we want to do first.
01:50
So let's go ahead and start a four loop from zero up to l and i++.
01:57
And then what we want to do is check whether or not there's an equality between the last to last or the left side and the right side, so we're forward and the reverse.
02:14
So let's make a boolean is palindrome...