title: What is the difference between ResponseEntity and ResponseEntity<?>
body: <p>In Restful API, what is the difference between <code>ResponseEntity</code> and <code>ResponseEntity&lt;?&gt;</code>?</p>
  
  <p>When should we use one or the other? This is my code:</p>
  
  <pre><code>@PutMapping
  public ResponseEntity&lt;?&gt; updateArticle(@PathVariable("slug") String slug,
                                         @AuthenticationPrincipal User user,
                                         @Valid @RequestBody UpdateArticleParam updateArticleParam) {
      return articleRepository.findBySlug(slug).map(article -&gt; {
          if (!AuthorizationService.canWriteArticle(user, article)) {
              throw new NoAuthorizationException();
          }
          article.update(
              updateArticleParam.getTitle(),
              updateArticleParam.getDescription(),
              updateArticleParam.getBody());
          articleRepository.save(article);
          return ResponseEntity.ok(articleResponse(articleQueryService.findBySlug(slug, user).get()));
      }).orElseThrow(ResourceNotFoundException::new);
  }
  
  @DeleteMapping
  public ResponseEntity deleteArticle(@PathVariable("slug") String slug,
                                      @AuthenticationPrincipal User user) {
      return articleRepository.findBySlug(slug).map(article -&gt; {
          if (!AuthorizationService.canWriteArticle(user, article)) {
              throw new NoAuthorizationException();
          }
          articleRepository.remove(article);
          return ResponseEntity.noContent().build();
      }).orElseThrow(ResourceNotFoundException::new);
  }
  </code></pre>