Need help fixing my project's various errors
第18行:语法错误,输入}以完成classBody。
第33/38行:令牌上的语法错误,而是预期的注释名称。
第416行:此行的多个标记
- 语法错误,插入"EnumBody"
完成EnumDeclaration
- 语法错误,插入")"到
完整的修饰符
- 语法错误,插入"枚举
标识符"完成EnumHeader
- 语法错误,插入")"到
完整表达
- 语法错误,插入"}"
完整的ClassBody
- 语法错误,插入"}"
完成MethodBody
- 语法错误,插入";" 至
完整声明
以上,我有几个错误,我不知道如何解决。 我也试图看看我的代码是否起作用。 我正在尝试从相反类别的输入中获取名称/数字的输出,并将其放入textView"显示"。
我的代码:(或我的代码与行号)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | package walmart.namespace; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class WalmartActivity extends Activity { /** Called when the activity is first created. */ EditText department; EditText name; Button search; String display; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); department = (EditText) findViewById(getResources().getIdentifier("etNum","id", getPackageName())); name = (EditText) findViewById(getResources().getIdentifier("etName","id", getPackageName())); search = (Button) findViewById(getResources().getIdentifier("btnSearch","id", getPackageName())); final String Display; department.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { et.setText(""); } name.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { et.setText(""); } search.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { switch (department) { case 1: display ="food"; case 2: display ="Health and Beauty Aids"; case 3: display ="Stationary and Books"; case 4: display ="Paper Goods"; case 5: display ="Home Entertainment"; case 6: display ="Cameras and Film"; case 7: display ="Toys"; case 8: display ="Pets and Pet Supplies"; case 9: display ="Sporting Goods"; case 10:display ="Automotive"; case 11:display ="Hardware"; case 12: display ="Paint and Accessories"; case 13: display ="Household Chemicals"; case 14: display ="Housewares"; case 15: display ="Appliances"; case 16: display ="Lawn and Garden"; case 17: display ="Home Furnishings"; case 18: display ="Seasonal"; case 19: display ="Fabrics and Crafts"; case 20: display ="Domestic Goods"; case 21: display ="Curtains"; case 22: display ="Bedding"; case 23: display ="Mens"; case 24: display ="Boys"; case 25: display ="Shoes"; case 26: display ="Infants and Toddlers"; case 27: display ="Ladies Socks"; case 28: display ="Nylon Hosiery"; case 29: display ="Lingerie"; case 30: display ="Foundations"; case 31: display ="Handbags and Accessories"; case 32: display ="Jewlery"; case 33: display ="Girls"; case 34: display ="Ladies"; case 36: display ="Outerwear"; case 39: display ="Food Services"; case 40: display ="Pharmacy"; case 46: display ="Cosmetics"; case 49: display ="Optical"; case 56: display ="Horticulture"; case 58: display ="Income"; case 77: display ="Large Appliances"; case 80: display ="Service Deli"; case 81: display ="Bread"; case 82: display ="Impulse Buys"; case 83: display ="Seafood"; case 84: display ="Floral"; case 85: display ="1 Hour Photo"; case 86: display ="Fresh Flowers and Balloons"; case 87: display ="Wireless"; case 89: display ="Travel Center"; case 90: display ="Dairy"; case 91: display ="Frozen Foods"; case 92: display ="Grocery"; case 93: display ="Meats"; case 94: display ="Produce"; case 95: display ="DSD Grocery"; case 96: display ="Liqour"; case 97: display ="Processed Meats"; case 98: display ="Bakery"; case 99: display ="Store Use"; } { if (name.equals("Electronics")) { display ="5"; } else if (name.equals("candy")) { display=("1"); } else if (name.equals("Tobacco")) { display=("1"); } else if (name.equals("Makeup")) { display=("2"); } else if (name.equals("Stationary")) { display=("3"); } else if (name =="Books") { display=("3"); } else if (name =="Napkins") { display=("4"); } else if (name =="Paper Plates") { display=("4"); } else if (name =="Paper") { display=("4"); } else if (name =="Video Games") { display=("5"); } else if (name =="Movies") { display=("5"); } else if (name =="Cameras") { display=("6"); } else if (name =="Film") { display=("6"); } else if (name =="Photo") { display=("6"); } else if (name =="Toys") { display=("7"); } else if (name =="Fishing Rods") { display=("9"); } else if (name =="Sporting Equipment") { display=("9"); } else if (name =="Sporting Goods") { display=("9"); } else if (name =="Car Stereos") { display=("10"); } else if (name =="Automotive") { display=("10"); } else if (name =="Tools") { display=("11"); } else if (name =="Heaters") { display=("11"); } else if (name =="Fans") { display=("11"); } else if (name =="Hardware") { display=("11"); } else if (name =="Paint") { display=("12"); } else if (name =="Bleach") { display=("13"); } else if (name =="Ammonia") { display=("13"); } else if (name =="Chemicals") { display=("13"); } else if (name =="Towels") { display=("14"); } else if (name =="Kitchen Accessories") { display=("14"); } else if (name =="Towels") { display=("14"); } else if (name =="Appliances") { display=("15"); } else if (name =="Plants") { display=("16"); } else if (name =="Grills") { display=("16"); } else if (name =="Lawn & Garden") { display=("16"); } else if (name =="Furniture") { display=("17"); } else if (name =="Seasonal") { display=("18"); } else if (name =="Fabrics and Crafts") { display=("19"); } else if (name =="Domestics") { display=("20"); } else if (name =="Curtains") { display=("21"); } else if (name =="Bedding") { display=("22"); } else if (name =="Mens") { display=("23"); } else if (name =="Boys") { display=("24"); } else if (name =="Shoes") { display=("25"); } else if (name =="Infants") { display=("26"); } else if (name =="Ladies Socks") { display=("27"); } else if (name =="Pantyhose") { display=("28"); } else if (name =="Lingerie") { display=("29"); } else if (name =="Purses") { display=("31"); } else if (name =="Handbags") { display=("31"); } else if (name =="Jewelry") { display=("32"); } else if (name =="Girls") { display=("33"); } else if (name =="Maternity") { display=("35"); } else if (name =="Outerwear") { display=("36"); } else if (name =="Pharmacy") { display=("40"); } else if (name =="Cosmetics") { display=("46"); } else if (name =="Optical") { display=("49"); } else if (name =="Large Appliances") { display=("77"); } else if (name =="Deli") { display=("80"); } else if (name =="Bread") { display=("81"); } else if (name =="Seafood") { display=("83"); } else if (name =="Floral") { display=("84"); } else if (name =="One Hour Photo") { display=("85"); } else if (name =="Fresh Flowers") { display=("86"); } else if (name =="Cell Phones") { display=("87"); } else if (name =="Travel Center") { display=("89"); } else if (name =="Luggage") { display=("89"); } else if (name =="Dairy") { display=("90"); } else if (name =="Milk") { display=("90"); } else if (name =="Frozen Foods") { display=("91"); } else if (name =="Frozen") { display=("91"); } else if (name =="Grocery") { display=("92"); } else if (name =="Meats") { display=("93"); } else if (name =="Produce") { display=("94"); } else if (name =="Liquor") { display=("96"); } else if (name =="Bakery") { display=("98"); } } |
我在这里修复了你的格式问题:http://pastebin.com/YijryAPK
请注意,由于错误使用Java,错误仍然存在。 您不能在