0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

コードの差分表示の仕方

Last updated at Posted at 2025-03-13
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
public class HelloWorld {
    public static void main(String[] args) {
-       System.out.println("Hello, World!");
+       System.out.println("こんにちは, 世界!");
+       System.out.println("diff_java表示");
    }
}

下記のように、行の先頭に+または-を記述することにより、差分表示になる。

public class HelloWorld {
    public static void main(String[] args) {
-       System.out.println("Hello, World!");
+       System.out.println("こんにちは, 世界!");
+       System.out.println("diff_java表示");
    }
}

言語名は、言語の先頭にdiff_とつける
javadiff_java
javascriptdiff_javascript

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?