KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > coding > InputMultipleStringLiterals


1 package com.puppycrawl.tools.checkstyle.coding;
2
3 public class InputMultipleStringLiterals
4 {
5     String JavaDoc m = "StringContents";
6     String JavaDoc m1 = "SingleString";
7     String JavaDoc m2 = "DoubleString" + "DoubleString";
8     String JavaDoc m3 = "" + "";
9     String JavaDoc m4 = "" + "";
10     String JavaDoc debugStr = ", " + ", " + ", ";
11
12     void method1() {
13         String JavaDoc a1 = "StringContents";
14         System.out.println("StringContents");
15         // The following is not reported, since it is two string literals.
16
String JavaDoc a2 = "String" + "Contents";
17     }
18 }
19
Popular Tags