title: How to return true or false in this scenario?
body: <p>Here is a my code</p>
  
  <pre><code>   public boolean changePassword(String password, String id) {
  
      try {
  
          StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
          StrictMode.setThreadPolicy(policy);
  
          Class.forName("com.mysql.jdbc.Driver");
          Connection conn = DriverManager.getConnection(DB_URL, DBuser, DBpassword);
  
  
          Statement st = conn.createStatement();
          String updateQuery = "update teacher_registration set password="+password+"where teacher_id="+id;
          ResultSet rs = st.executeQuery(updateQuery);
  
          if(rs!=null){
              return true;
          }else{
              return false;
          }
      } catch (Exception e) {
          e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>I want to return true if rs is not null else return false.</p>
  
  <p>But i am getting an error at the closing bracket of this method. It is asking me to return a true or false again even if I did so in the try catch block earlier. </p>
  
  <p>This is my first time working with java.</p>
  
  <p>Please HELP!</p>