whats the simplest way to write a palindrome string using a while loop in java. : Ive searched about everywhere but I just cant find any thing very concrete I've been working at this code for awhile but it keeps stumping me.

    public static void main(String[] args)
	{
		System.out.println(palindrome("word"));
	}
	
		public static boolean palindrome(String myPString)
		{
			Scanner in = new Scanner(System.in);
			
			System.out.println("Enter a word:");
			String word = in.nextLine();
			String reverse = "";
			int startIndex = 0;
			int str = word.length() -1;
			
			while(str >=0)
			{
					reverse = reverse + word.charAt(i);
				
			}

