I wrote this script but the Else statement wont work.
Exception in thread "main" java.lang.Error: Unresolved compilation problem: Syntax error on token "else", delete this token
import java.util.Scanner;
public class Question4 {
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("Welcome to the secret secret and secure notepad!");
System.out.println("What is your name?");
String name = input.next();
System.out.println("Please enter a password:");
String password = input.next();
System.out.println("Please confirm password: ");
String confirmpassword = input.next();
if (password == (confirmpassword))
System.out.println("Your password has been set. Now entering your Notepad!");
System.out.println("Here are your notes");
else
System.out.println("Passwords do not match! Error Code 1");```