This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How can I fix this code?  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Java Cowboy
Sheriff
Posts: 16083
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be a lot easier if you would add an explanation to your code, besides only the title "How can I fix this code?".

What is the code supposed to do? What is the problem - do you get a compiler error, or an error when you try to run it? Or does it run, but produce output that is different from what you expected? If that's the case, then what exactly did you expect, what does it do in reality and how does that differ from what you expected?

Just by looking at it I can already see an error in the very first line: you are trying to import a class named Sec from the package java.util, but that package does not contain a class named Sec. What was your intention with that line? You're not using the class Sec in the code, so it seems redundant.

There are more errors. For example, String Map<String, String> in line 9 and nre HashMap in line 12, and i+=2> in line 16. You'll need to fix those syntax errors first.
 
Marshal
Posts: 5635
390
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lots of syntax errors. Probably not much benefits in fixing this if you don't know basic (very) Java syntax.

What's that all about? Maybe a homework to fix compiler errors (that would be hard, because isn't clear to which shape this needs to be fixed, could be many interpretations of final result)?
Writing such code at work (hopefully not)?

Where did you get that code from?
 
Marshal
Posts: 58829
179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Afraid that doesn't help. There is no HTML5() method there. You are mistaken about the syntax for “inputs”, but there are no inputs there
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have multiple syntax errors that need to be corrected, like the missing HTML5() method. It would be recommended you fix those then come back to us if you still have any issues.
 
Sheriff
Posts: 4838
135
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ethan Mooney wrote:You have multiple syntax errors that need to be corrected,


Please be sure you are contributing something new to the thread before you post.

... like the missing HTML5() method.


The code does not need a HTML5() method.  It has a constructor.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!