Home  >  Q&A  >  body text

怎么把c#程序转成java?

一个1000行左右的c#程序中,充斥100多行的goto语句,该怎么改?能直接改为continue to或者break to语句吗?其他还好办。。。。

PHP中文网PHP中文网2765 days ago1075

reply all(11)I'll reply

  • 黄舟

    黄舟2017-04-17 17:11:47

    If I have time to write a regex, I can modify 100 gotos...

    reply
    0
  • 阿神

    阿神2017-04-17 17:11:47

    More than a hundred lines of goto...
    I have been writing C# for several years...I have never used goto...(sad)

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 17:11:47

    Whoever wrote the goto can change it.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 17:11:47

    The easiest way is to rewrite it manually

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 17:11:47

    C# to Java Converter

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 17:11:47

    I can’t work with people who write gotos.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:11:47

    Let alone goto, it is wrong to write more than a hundred lines for a function.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:11:47

    1. Is there documentation for these codes? Is there a specification document? Is there a requirements document?
    If there is a specification document, rewrite it according to the specification document. The core algorithm can refer to C#. If there is unsupported syntax, use alternative syntax to implement it (goto is nothing more than used to implement loops, recursions, judgments, etc.)
    If there is no specification document, it will be fine if there is a requirement document. Rewrite the specifications according to the requirements document, and then write the program. You can also refer to the C# code.

    2. There is no documentation.
    Understand the code, then write specification documents, and then develop JAVA.

    reply
    0
  • 阿神

    阿神2017-04-17 17:11:47

    It is best to make changes after understanding the code business.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:11:47

    Uncouple and reconstruct.

    reply
    0
  • Cancelreply