枚举、异常和String类的方法14

1 篇文章 0 订阅
1 篇文章 0 订阅
/**
 * 枚举 : 对象可数的类型, 不能再创建新对象.
 */
enum Season { // public static final 修饰的量. 称为全局常量

    // 给Week枚举加上属性, String feel. 添加构造器. 改造toString().

    SPRING("绿色"), SUMMER("红色"), AUTUMN, WINTER;

    {
        color = "白色"; // 非静态语句块和显式赋值的顺序是按照写的顺序来执行的 并且它们都是先于构造器
    }

    private String color = "黑色";

    private Season() {}

    private Season(String color) { // 构造器必须是私有的
        this.color = color;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return super.toString() + " Season{" +
                "color='" + color + '\'' +
                '}';
    }
}

public class EnumTest {

    public static void main(String... args) {
        int n = Integer.parseInt(args[0]); // 把命令行参数的第一个字符串转换成真的整数.
        //new Season();
        Season s1 = Season.SPRING; // 直接通过类.常量对象, 最直接的方式
        System.out.println(s1); // s1.toString();
        s1 = Season.valueOf("AUTUMN"); // 根据枚举对象名获取枚举对象, 大小写敏感
        System.out.println(s1);
        Season[] values = Season.values(); // 获取保存所有枚举对象的对象数组.
        s1 = values[n];
        System.out.println("****************************");
        System.out.println(s1);
        // s1中指向的对象是谁不确定... 枚举 : 可以列举, 穷举
        switch (s1) { // switch(变量) 变量的类型:非long整数, 字符串, 枚举
            case SPRING: // 常量 : 字面量, 被final修饰的量
                System.out.println("春季");
                break;
            case SUMMER:
                System.out.println("夏天");
                break;
            case AUTUMN:
                System.out.println("秋天");
                break;
            case WINTER:
                System.out.println("冬天");
                break;
        }
    }
}
/**
 * 异常 : 程序在运行时出现的非正常状况. 异常会导致程序崩溃
 * 异常的分类 :
 * 1) 按照程度来分
 *      1) Error 严重错误.
 *      2) Exception 一般问题.
 * 2) 按照处理方式来分
 *      1) 受检异常(checked) 在程序中必须接受检查和处理的异常. 如果不处理编译错误,也称为编译时异常
 *          Exception及其子类(RuntimeException及其子类除外)
 *      2) 非受检异常(unchecked) 在程序中不是必须接受检查和处理的异常, 如果不处理不生编译错误, 但是运行时仍会出问题, 也称为运行时异常
 *          Error及其子类.
 *          RuntimeException及其子类.
 *
 * 异常必须处理 : 适用于所有异常, 包括Error
 *      1) 捕获
 *          try {
 *             可能抛出异常的语句;
 *          } catch (可能的异常类型1 引用) {
 *              对异常处理.
 *          } catch (可能的异常类型2 引用) {
 *              对异常处理.
 *          } .....
 *          catch (Exception e) {
 *              确保万无一失
 *          } finally { // final 修饰符, 修饰类, 方法, 变量
 *              释放不在GC区中资源, 而是由OS管理的资源. 比如文件,网络等硬件资源.
 *          }
 *
 *          try catch
 *          try catch finally
 *          try finally
 *
 *      2) 抛出 : 使用throws体现异常的抛出.
 *
 *          在方法声明中的throws 异常类型列表, 作用是警告调用者, 此方法有风险.
 *          在方法体中使用throw语句, 在方法中真的抛出异常对象.
 *
 *          可以只有throws而没有throw
 *          只要有throw必须要有throws
 *
 *          throws 是警告
 *          throw 是玩真的.
 *
 *      方法覆盖条件中对于异常的描述 :
 *      要求如下 :
 *          1) 方法签名一致, 子类方法的返回值的对象类型可以小于等于父类方法返回的对象类型.
 *          2) 子类方法的访问控制修饰符的范围要大于等于父类的.
 *          3) 被覆盖方法不可以被private, static, final.
 *          4) 子类方法抛出的受检异常范围要小于等于父类方法抛出的受检异常.
 *
 *      3) 先捕获, 再抛出.
 *          先
 *          try {
 *              可能抛出异常的语句;
 *          } catch(任意异常类型 引用) {
 *              throw new 自定义异常(引用);
 *          }
 *
 *  处理方式的选择 :
 *      1) 入口方法尽量捕获.
 *      2) 功能方法尽量抛出.
 *
 */

// 自定义异常 : 1) 继承Exception 表明它是一个异常, 2) 提供2个构造器一个String,一个是Throwable 创建自定义异常对象方便
class DividedByZeroException extends Exception { // 这是受检异常, 必须要处理

    public DividedByZeroException(String message) {
        super(message); // 间接调用到父类构造, 完成私有的detailMessage的初始化.
    }
    public DividedByZeroException(Throwable cause) { // 对象关联专用
        super(cause);
    }
}

public class ExceptionTest {

    public static int divide(int x, int y) throws DividedByZeroException {
        try {
            return x / y;
        } catch (ArithmeticException e) {
            throw new DividedByZeroException(e); // 包装 : 自定义异常对象内部包含一个其他异常对象.
        }
    }

    public static void main(String[] args) {
        try {
            try {
                System.out.println(divide(10, 2));
                System.out.println(divide(10, 0));
            } catch (DividedByZeroException e) {
                System.out.println(e.getMessage());
            }
            System.out.println(divide(20, 5));
        } catch (DividedByZeroException e) {
            e.printStackTrace();
        } finally {
            System.out.println("finally");
        }
    }
}

class ExceptionTest3 {
    // throws的作用是警告调用者, 调用此方法有风险!!!
    public static int divide(int x, int y) throws DividedByZeroException { // throws和throw最好要一致, 显得诚实
        if (y == 0) {
            // 真的抛出一个异常对象, 当前方法就会提前弹栈返回结束, 并给调用者产生破坏.
            throw new DividedByZeroException("除数不可以为0错误!!!!");
        }
        return x / y;
    }

    //public static void main(String[] args) throws DividedByZeroException { main方法虽然可以抛出异常, 但是不要抛.
    public static void main(String[] args) {
        try {
            System.out.println(divide(10, 2));
            System.out.println(divide(10, 0));
        } catch (DividedByZeroException e) {
            System.out.println(e.getMessage());
        }

        System.out.println("end");
    }
}

class ExceptionTest2 {

    public static int divide(int x, int y) {
        if (y == 0) {
            RuntimeException re = new RuntimeException("除数不可以为0"); // throw和return效果一样, 都是让方法返回的
            throw re;
            // return 是和平返回, throw 带有破坏性的返回.
        }
        return x / y;
    }

    public static void main(String[] args) {
        try {
            System.out.println(divide(10, 2));
            System.out.println(divide(10, 0));
        } catch (RuntimeException e) {
            System.out.println(e.getMessage());
        }
        System.out.println("end...");
    }
}


class ExceptionTest1 {

    public static void main(String[] args) {
        System.out.println("main begin");

        boolean b = true;
        if (b) {
            //return;
        }

        try {
            int n = Integer.parseInt(args[0]);
            System.out.println(n);
            return;
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println(e);
        } catch (NumberFormatException e) {
            System.out.println(e.getMessage());
        } catch (Exception e) {
            System.out.println("其他可能的异常 : " + e);
        } finally {
            // 无论前面try catch中发生什么, 我都要执行....
            System.out.println("finally");
        }

        System.out.println("main end");
    }
}

/**
 * String : 是内容不可改变的Unicode字符序列(CharSequence).
 * 可以简单地理解为是一个char[]
 *                  0 2       10       15       21        27   32 34
 * String string = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
 *
 * ###public int length(). string.length() => 35 获取字符串长度(字符数)
 * ###public char charAt(int index) 获取指定下标位置处的字符 string.charAt(12) => '欢', string.charAt(18) => '我';
 * ##public char[] toCharArray() 获取内部的char[]
 *       char result[] = new char[value.length]; // 创建一个新数组, 容量和内部的value一样大.
 *
 *       for (int i = 0; i < value.length; i++) {
 *           result[i] = value[i];
 *       }
 *
 *       System.arraycopy(value, 0, result, 0, value.length);
 *       // 第一个参数是源数组对象, 第二个参数是源数组的开始下标, 第三个参数是目标数组对象, 第四个参数是目标数组的开始下标
 *       // 第五个参数是要复制的元素个数.
 * public boolean equals(Object anObject)
 * public boolean equalsIgnoreCase(String anotherString) 比较字符串内容, 忽略大小写
 * public int compareTo(String anotherString)
 *
 *                  0 2       10       15       21        27   32 34
 * String string = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
 *
 * #####
 * public int indexOf(String s), 获取参数中的子串在当前字符串中首次出现的下标. 如果不存在返回-1
 *              string.indexOf("喜欢") => 11
 *              string.indexOf("讨厌")
 * public int indexOf(String s ,int startpoint)获取参数中的子串在当前字符串中首次出现的下标. 从startPoint位置开始搜索
 *              string.indexOf("喜欢", 12) => 16, string.indexOf("喜欢", 17) => 23
 *
 * public int lastIndexOf(String s)
 *              string.lastIndexOf("喜欢") => 23
 * public int lastIndexOf(String s ,int startpoint)
 *              string.lastIndexOf("喜欢", 22) => 16, string.lastIndexOf("喜欢", 15) => 11
 *
 * public boolean startsWith(String prefix) 判断当前串是否以参数中的子串为开始
 * public boolean endsWith(String suffix)判断当前串是否以参数中的子串为结束
 *
 *                  0 2       10       15       21        27   32 34
 * String string = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
 *
 * #####
 * public String substring(int start,int end) 从当前字符串中取子串, 从start开始(包含),到end结束(不包含)
 *              string.substring(10, 14) => "我喜欢你";
 * public String substring(int startpoint) 从当前字符串中取子串, 从start开始(包含),到最后
 *
 * public String replace(char oldChar,char newChar) 替换字符串中的所有oldChar为newChar
 *              string.replace(' ', '#') =>
 *
 * // 参数中的字符串符合 正则表达式.
 * public String replaceAll(String old,String new) 替换字符串中的所有old子串为new子串.
 *
 * public String trim() 修剪字符串首尾的空白字符. 空白字符就是码值小于等于32的字符
 *
 * public String concat(String str) 字符串连接
 * public String toUpperCase() 变成大写
 * public String toLowerCase() 变成小写
 * String s = "abc,yy,123,qq,我和你,zzz";
 * String[] arr = s.split(",");
 * public String[] split(String regex) 以参数 中的子串为切割器,把字符串切割成多个部分.
 */
public class StringTest {

    @Test
    public void test8() {
        String s1 = "abc";
        String s2 = "ABC";
        System.out.println(s1.equals(s2));
        System.out.println(s1.equalsIgnoreCase(s2));

        System.out.println(s1.toLowerCase().equals(s2.toLowerCase()));
    }

    @Test
    public void test7() {
        String s = "abc,yy,123,qq,我和你,zzz";
        String[] arr = s.split(",");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }

    @Test
    public void test6() {
        class A {};
        String string = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
        String s = string.toUpperCase();
        System.out.println(s);
        String s1 = string.toLowerCase();
        System.out.println(s1);
    }

    @Test
    public void test5() {
        String string = "  \r\n\t \b abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123 \r\n\t\t\t   \b ";
        System.out.println(string);
        String trim = string.trim();
        System.out.println("trim = " + trim);
    }

    @Test
    public void test4() {
        String string = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
        String replace = string.replace(' ', '#');
        System.out.println(replace);

        String replace1 = string.replace("喜欢", "爱慕");
        System.out.println(replace1);

        String s2 = string.replaceAll("喜欢", "特别讨厌,真的讨厌");
        System.out.println(s2);

        // 消除字符串中的所有空格
        String s = string.replaceAll(" ", "");
        System.out.println(s);

        String s3 = string.replaceAll("", "@");
        System.out.println(s3);
    }

    //将一个字符串进行反转。将字符串中指定部分进行反转。比如将“abcdefg”反转为”abfedcg”
    @Test
    public void exer3() {
        String string = "abcdefg";
        int begin = 2;
        int end = 6;

        // 切成3段, 只反转中间部分.
        String s1 = string.substring(0, begin);
        String s2 = string.substring(begin, end);
        String s3 = string.substring(end);

        char[] chars = s2.toCharArray();
        for (int i = 0; i < chars.length / 2; i++) {
            char tmp = chars[i]; //
            chars[i] = chars[chars.length - 1 - i];
            chars[chars.length - 1 - i] = tmp;
        }
        String result = s1 + new String(chars) + s3;
        System.out.println("result = " + result);
    }

    @Test
    public void test3() {
        String string = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
        String substring = string.substring(10, 14);
        System.out.println("substring = " + substring);
        String substring2 = string.substring(10, string.length());
        System.out.println("substring2 = " + substring2);
    }

    @Test
    public void test2() {
        String string = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
        boolean b = string.startsWith("  abc");
        System.out.println(b);
        boolean b2 = string.endsWith("zzz123");
        System.out.println(b2);
    }

    /*获取一个字符串在另一个字符串中出现的次数。
    比如:获取"ab"在 "abkkcadkabkebfkabkskab"
    中出现的次数*/
    @Test
    public void exer2() {
        String s1 = "ababa";
        String s2 = "aba";
        int count = 0;
        int index = 0;
        while (true) {
            index = s1.indexOf(s2, index);
            //if (从长串中检索短串的下标时, 返回-1) {
            if (index == -1) {
                //结束这个过程
                break;
            }
            count++;
            index++;
        }
        System.out.println(count);
    }

    @Test
    public void test1() {
        String string = new String();
        String s1 = new String("abc");
        String s2 = new String("abC");
        System.out.println(s1 == s2);

        System.out.println(s1.equals(s2));
        System.out.println(s1.hashCode());
        System.out.println(s2.hashCode());

        System.out.println(s1.compareTo(s2));
        String string2 = "  abcAQQY 我喜欢你,你喜欢我吗?我不喜欢你 zzz123  ";
        int indexOf = string2.indexOf("讨厌");
        System.out.println(indexOf);
    }
}
/**
 * StringBuilder : 是内容可以改变的Unicode字符序列.
 * <p>
 * 1. StringBuffer()初始容量为16的字符串缓冲区
 * 2.StringBuffer(int size)构造指定容量的字符串缓冲区
 * 3.StringBuffer(String str)将内容初始化为指定字符串内容
 * <p>
 * StringBuilder append(...) 追加任意数据到当前串末尾.
 * StringBuilder insert(int index, ...) 在指定位置处插入任意内容
 * StringBuilder delete(int beginIndex, int endIndex) 删除一个区间
 * StringBuilder setCharAt(int index, char ch) 替换指定下标处的字符为ch
 * <p>
 * private int newCapacity(int minCapacity) {
 * // overflow-conscious code
 * int newCapacity = (value.length << 1) + 2;
 * if (newCapacity - minCapacity < 0) {
 * newCapacity = minCapacity;
 * }
 * return (newCapacity <= 0 || MAX_ARRAY_SIZE - newCapacity < 0)
 * ? hugeCapacity(minCapacity)
 * : newCapacity;
 * }
 * <p>
 * StringBuffer : 古老的类 速度慢 线程安全, 不使用
 * StringBuilder  : 新的类 速度快 线程不安全.
 */
public class StringBuilderTest {

    @Test
    public void test5() {
        String str = null;
        StringBuffer sb = new StringBuffer();
        sb.append(str); // "abc" + null
        String str2 = "abc";
        str2 += null;

        System.out.println(str2);
        System.out.println(sb);

        //String s = new String(str);
        //System.out.println(s);
        StringBuffer stringBuffer = new StringBuffer(str);
        System.out.println(stringBuffer);

    }

    @Test
    public void test4() {
        String text = "";
        long startTime = 0L;
        long endTime = 0L;
        StringBuffer buffer = new StringBuffer("");
        StringBuilder builder = new StringBuilder("");
        startTime = System.currentTimeMillis();
        for (int i = 0; i < 20000; i++) {
            buffer.append(String.valueOf(i));
        }
        endTime = System.currentTimeMillis();
        System.out.println("StringBuffer的执行时间:" + (endTime - startTime));
        startTime = System.currentTimeMillis();
        for (int i = 0; i < 20000; i++) {
            builder.append(String.valueOf(i));
        }
        endTime = System.currentTimeMillis();
        System.out.println("StringBuilder的执行时间:" + (endTime - startTime));
        startTime = System.currentTimeMillis();
        for (int i = 0; i < 20000; i++) {
            text = text + i;
        }
        endTime = System.currentTimeMillis();
        System.out.println("String的执行时间:" + (endTime - startTime));

    }

    @Test
    public void test3() {
        StringBuilder stringBuilder = new StringBuilder(); // 内部容量为16
        stringBuilder.append(123);
        stringBuilder.append("abc");
        stringBuilder.append(3.14);
        stringBuilder.append(true);
        stringBuilder.append('我');
        stringBuilder.append('你');

        stringBuilder.append('A');
    }

    // 声明3个字符串, 赋值一些内容, 把第一个直接变成StringBuffer对象, 把第2个串追加在末尾, 把第3个串插入到最前面.
    // 打印输出.
    @Test
    public void exer1() {
        String s1 = "abclkjafd";
        String s2 = "234239487234";
        String s3 = "我是一些汉字";
        StringBuilder insert = new StringBuilder(s1).append(s2).insert(0, s3);
        System.out.println(insert);
    }

    @Test
    public void test2() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(123).append("abc").append(3.14).append(true).append('A').insert(3, "我和你").delete(6, 10).setCharAt(3, '好');
        System.out.println(stringBuilder);
    }

    @Test
    public void test1() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(123);
        stringBuilder.append("abc");
        stringBuilder.append(3.14);
        stringBuilder.append(true);
        stringBuilder.append('A'); //123abc3.14trueA

        stringBuilder.insert(3, "我和你"); //123我和你abc3.14trueA

        System.out.println(stringBuilder);

        stringBuilder.delete(6, 10);

        System.out.println(stringBuilder); //123我和你.14trueA

        stringBuilder.setCharAt(3, '好');

        System.out.println(stringBuilder);

        //StringBuilder stringBuilder2 = new StringBuilder(1024);
        //System.out.println(stringBuilder2.length());

    }

}
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;

// 当无法创建对象时, 有2种做法
// 1) 找当前类的静态方法, 看有没有能返回对象的方法
// 2) 找它的工厂类, 通过工厂获取对象.

/**
 * Date : 年有1900, 月也是少1, toString()不友好
 * Calendar : 内部用数组, 增加复杂度, 内容可以改变, 不好, 月份少1.
 *
 * java8 一步到位.
 * LocalDate 日期
 * LocalTime 时间
 * LocalDateTime 日期时间
 *
 */

public class DateTest {

    public static void main(String[] args) {
        LocalTime localTime = LocalTime.now(); //new LocalTime();
        System.out.println(localTime);

        LocalTime localTime1 = localTime.withHour(20);
        System.out.println(localTime1);

        LocalDateTime dateTime = LocalDateTime.now();
        System.out.println(dateTime);

        // 如何一步到位创建日期
        // 2008, 8, 8
        //new LocalDate(2008,8,8);
        LocalDateTime of = LocalDateTime.of(2008, 8, 8, 20, 30, 40);
        System.out.println(of);

        //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //String format = sdf.format(of);
        //System.out.println(format);

        //new DateTimeFormatter();
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = dateTimeFormatter.format(of);
        System.out.println(format);
    }

    public static void main6(String[] args) {
        LocalDate date = LocalDate.now(); //new LocalDate();
        System.out.println(date);
        int year = date.getYear();
        int month = date.getMonthValue();
        int day = date.getDayOfMonth();

        System.out.println("year = " + year);
        System.out.println("month = " + month);
        System.out.println("day = " + day);

        //date.setYear(2008);
        // 伴随新的年会产生新对象
        LocalDate date2 = date.withYear(2008).withMonth(8).withDayOfMonth(8);
        System.out.println(date2);

        LocalDate date3 = date2.plusYears(5);

        System.out.println(date3);
        // 创建一个LocalDate对象, 把它变成你的生日. 然后再获取你的百日.
    }


    public static void main5(String[] args) {
        // 创建一个Calendar对象, 把它变成你的生日. 然后再获取你的百日.
        Calendar instance = Calendar.getInstance();
        // 1978, 6, 9
        instance.set(Calendar.YEAR, 1978);
        instance.set(Calendar.MONTH, 5);
        instance.set(Calendar.DAY_OF_MONTH, 9);

        System.out.println(instance.getTime());

        instance.add(Calendar.DAY_OF_MONTH, 100);

        System.out.println(instance.getTime());
    }

    public static void main4(String[] args) {
        // Calendar日历.
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar);

        // 获取年
        int year = calendar.get(Calendar.YEAR); // 没有单独的获取方法
        int month = calendar.get(Calendar.MONTH); // 内部保存的月比实际小1.
        int day = calendar.get(Calendar.DAY_OF_MONTH);
        System.out.println("year = " + year);;
        System.out.println("month = " + month);
        System.out.println("day = " + day);

        // 设置. 2008, 8, 8
        //calendar.setYear(2008);
        calendar.set(Calendar.YEAR, 2008); // 没有单独的设置方法
        calendar.set(Calendar.MONTH, 7);
        calendar.set(Calendar.DAY_OF_MONTH, 8);

        Date time = calendar.getTime();
        System.out.println(time);

        // 加减
        calendar.add(Calendar.MONTH, 5); // 5个月后

        System.out.println(calendar.getTime());

        calendar.add(Calendar.DAY_OF_MONTH, -500);
        System.out.println(calendar.getTime());

    }

    public static void main3(String[] args) {
        // 北京奥运会 2008, 8, 8
        Date date = new Date(2008, 8, 8); // 直接创建对象会有问题
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(sdf.format(date));
    }

    public static void main2(String[] args) {
        long millis = System.currentTimeMillis();
        System.out.println(millis);

        Date date = new Date();
        System.out.println(date);

        //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss S E");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String format = sdf.format(date); // 把日期对象格式化成和模式一致的串
        System.out.println(format);

        String str = "2018-05-02 11:20:30";
        try {
            Date parse = sdf.parse(str); // 把字符串解析成日期对象
            System.out.println(parse);
        } catch (ParseException e) {
            e.printStackTrace();
        }

        String format1 = sdf.format(millis); // 格式化毫秒
        System.out.println(format1);

    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值