Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

equalsIgnoreCase

807599May 7 2007 — edited May 7 2007
public void readInput()
	{
		System.out.println("Please enter some information on your character: ");
		System.out.print("Name: ");
		name = keyboard.nextLine();
		do
		{
			System.out.print("Health (0.0 - 100.0): ");
			health = keyboard.nextDouble();
		}
		while (health < 0.0 || health > 100.0);
			
		do
		{
			System.out.print("Armor (0.0 - 100.0): ");
			armor = keyboard.nextDouble();
		}
		while (armor < 0.0 || armor > 100.0);	
		
		System.out.print("Good or Evil?: ");
			goodOrEvil = keyboard.nextLine();
		
		**while (goodOrEvil.equalsIgnoreCase != good
			**		|| goodOrEvil.equalsIgnoreCase != evil)
		{
			System.out.print("Good or Evil?: ");
			goodOrEvil = keyboard.nextLine();
		}
					
		do
		{
			System.out.print("Ammo (1 - 50): ");
			ammo = keyboard.nextInt();
		}
		while (ammo < 1 || ammo > 50);
I'm so lost right now lol. I keep getting compiler errors when I compile this. I'm not really sure why, but I'm sure someone else can spot my problem pretty much instantly
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2007
Added on May 7 2007
10 comments
439 views