包装类: 针对八种基本数据类型定义相应的引用类型,使之有了类的特点,就可以调用类的方法
基本数据类型 | 包装类 |
boolean | Boolean |
byte | Byte |
short | Short |
int | Integer |
long | Long |
char | Character |
float | Float |
double | Double |
Junit单元测试类:
1.当前工程下-右键build path-add libraries-Junit4
2.在主类中创建一个空参的无返回值的方法, 用于代码测试 方法声明:@Test
3.导入import org.junit.Test
4.在test1()方法中,进行代码的编写
5.测试:双击方法名,右键run as-junit Test 即可
package com.aff.equals; import org.junit.Test; public class TestJunit { public static void main(String[] args) { String str = "str"; System.out.println(str); } @Test public void test1() { String str = "ss"; System.out.println(str); } }
输出结果:
ss