检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
sayHello(); } public static void sayHello() { System.out.println("Hello World"); } } 重构后 class ConvertToInstanceMethod
启动配置示例 以下是一个可运行的启动配置示例,该示例从 “test_file_name::test_class_name::test_method_name” 运行测试。 { "excludeTestIds": [], "request": "test", "jinja":
IntroduceFunctionalParameter { public static void main(String[] args) { System.out.println(generateText()); } private static String generateText()
启动配置示例 以下是一个可运行的启动配置示例,该示例从 “test_file_name::test_class_name::test_method_name” 运行测试。 { "excludeTestIds": [], "request": "test", "jinja":
public String testStr = "test"; public void DoSomeThing() { System.out.println(testStr); } } 重构后 package com.target.feature; public
hello + ", " + world; } public void print() { System.out.println(message); } } } 重构后 class ReplaceConstructor {
new ExtractImpl().print(); } public void print() { System.out.println("Hello World!"); } } 重构后 class ExtractImpl implements
static class NextClass { public void print() { System.out.println("Hello World!"); } } } 重构后 class Middleman
new ExtractImpl().print(); } public void print() { System.out.println("Hello World!"); } } 重构后 class ExtractImpl extends ExtractAbstract
sayHello(); } private static void sayHello() { System.out.println("Hello" + " " + "World!"); } } 重构后 class ExtractConstant
World!"; int n = 5; for (int i = 0; i < n; i++) { System.out.println(text); } } } 重构后 class ExtractMethod { public
this.data = data; } @Override public void run() { System.out.println("Data" + data.toString()); } } 重构后 import java.util
sayHello(); } private static void sayHello() { System.out.println("Hello" + " " + "World!"); } } 重构后 class ExtractParameter
sayHello(); } private static void sayHello() { System.out.println("Hello" + " " + "World!"); } } 重构后 class ExtractField
World!"; int n = 5; for (int i = 0; i < n; i++) { System.out.println(text); } } } 重构后 class ExtractMethodObject {
Person person = new Person(); person.name = "John"; System.out.println(person.name); } } 重构后 class Person { private String
} class InnerClass { public void print(){ System.out.println(str); } } } 重构后 class OuterClass { String
args) { } class Inner{ public void print() { System.out.println(message); } } } 重构后 class Outer { public String
{ public String myField; public void print() { System.out.println("Hello World"); } } private static abstract
staticStr = "test"; public static void staticMethod() { System.out.println(staticStr); } private static Boolean staticMethod2()