📄 example.java
字号:
package org.hanselexample;/** * Example class that is tested by the ExampleTest class. * This implements two methods and has one inner class. * * @author Niklas Mehner */public class Example { /** * The method returns the absolute value of an int. * @param i Int. * @return Absolute value of i. */ public int abs(int i) { if (i > 0) { return i; } else { return -i; } } /** * This method returns the sum of two numbers. * @param a First addend. * @param b Second addend. * @return Sum of a and b. */ public int add(int a, int b) { return new ExampleInner().add(a, b); } /** * The add method delegates the call to this class to * test the coverage of inner classes. */ private class ExampleInner { /** * This method returns the sum of two numbers. * @param a First addend. * @param b Second addend. * @return Sum of a and b. */ public int add(int a, int b) { return a + b; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -