A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/2847 below:

Use Explicit Types · Issue #2847 · pmd/pmd · GitHub

Proposed Rule Name: UseExplicitTypes

Proposed Category: One of [Best Practices | Error Prone]

Description:

Java 10 introduced the var keyword. This reduces the amount of typing but decreases the reading comprehension of the code. Please create a rule that flags the use of the var keyword.

Code Sample:

The line with var index should be flagged as a problem.

public static void myMethod()
{
   var index = 0;
}

Here is the "correct" code.

public static void myMethod()
{
   int index = 0;
}

Possible Properties:

Are there any other places where var can be used? If so, add those as properties.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4