Executors

本文详细介绍了Java并发工具类Executors的主要方法及其用途,包括创建固定线程数的线程池、单线程Executor、可缓存线程池及定时任务线程池等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

java.util.concurrent
<wbr style="line-height:25px"></wbr> Executors<wbr style="line-height:25px"><br style="line-height:25px"> java.lang.Object<br style="line-height:25px"> 继承者java.util.concurrent.Executors<br style="line-height:25px"> 此类是个<wbr style="line-height:25px"><span style="color:#003366; line-height:25px">工具类</span><wbr style="line-height:25px">,它提供对<span style="color:#0000ff; line-height:25px">Executor、ExecutorService、ScheduledExecutorService、ThreadFactory</span>和<span style="color:#0000ff; line-height:25px">Callable</span>类的一些实用方法。<br style="line-height:25px"> 此类支持以下<wbr style="line-height:25px"><span style="color:#003366; line-height:25px">各种方法</span><wbr style="line-height:25px">:<br style="line-height:25px"><span style="color:#000080; line-height:25px">*创建并返回设置有常用配置的</span><span style="color:#ff9900; line-height:25px">ExecutorService</span><span style="color:#000080; line-height:25px">的方法。<br style="line-height:25px"> *创建并返回设置有常用配置的</span><span style="color:#ff6600; line-height:25px">ScheduledExecutorService</span><span style="color:#000080; line-height:25px">的方法。<br style="line-height:25px"> *创建并返回“包装的”</span><span style="color:#339966; line-height:25px">ExecutorService</span><span style="color:#000080; line-height:25px">方法,它使特定于实现的方法不可访问,只让</span><span style="color:#008000; line-height:25px">ExecutorService</span><span style="color:#000080; line-height:25px">接口的方法可用。<br style="line-height:25px"> *创建并返回</span><span style="color:#ff9900; line-height:25px">ThreadFactory</span><span style="color:#000080; line-height:25px">的方法,它可将新创建的线程设置为已知的状态。<br style="line-height:25px"> *创建并返回非闭包形式的</span><span style="color:#ff9900; line-height:25px">Callable</span><span style="color:#000080; line-height:25px">的方法,这样可将其用于需要Callable的执行方法中。</span><br style="line-height:25px"> 主要方法:<br style="line-height:25px"><wbr style="line-height:25px">publicstaticExecutorService<span style="line-height:25px"></span><span style="color:#ff00ff; line-height:25px">newFixedThreadPool(intnThreads)</span><wbr style="line-height:25px"><br style="line-height:25px"> 创建一个可重用固定线程数的线程池,以共享的无界队列方式来运行这些线程。<br style="line-height:25px"> 在任意点,在大多数nThreads线程会处于处理任务的活动状态。如果在所有线程处于活动状态时提交附加任务,<br style="line-height:25px"> 则在有可用线程之前,附加任务将在队列中等待。如果在关闭前的执行期间由于失败而导致任何线程终止,<br style="line-height:25px"> 那么一个新线程将代替它执行后续的任务(如果需要)。在某个线程被显式地关闭之前,池中的线程将一直存在。<br style="line-height:25px"> 参数:<br style="line-height:25px"> nThreads-池中的线程数<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的线程池<br style="line-height:25px"> 抛出:<br style="line-height:25px"> IllegalArgumentException-如果nThreads&lt;=0<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">:它的全是core线程。其<wbr style="line-height:25px"><span style="color:#000080; line-height:25px">源码</span><wbr style="line-height:25px">如下:<br style="line-height:25px"><span style="color:#993300; line-height:25px">returnnew</span><span style="color:#0000ff; line-height:25px">ThreadPoolExecutor(nThreads,nThreads,0L,TimeUnit.MILLISECONDS,newLinkedBlockingQueue&lt;Runnable&gt;());</span><br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span><span style="line-height:25px"></span>ExecutorService<span style="color:#ff6600; line-height:25px">newFixedThreadPool</span>(intnThreads,ThreadFactorythreadFactory)<wbr style="line-height:25px"><br style="line-height:25px"> 创建一个可重用固定线程数的线程池,以共享的无界队列方式来运行这些线程,在需要时使用提供的ThreadFactory创建新线程。在任意点,在大多数nThreads线程会处于处理任务的活动状态。如果在所有线程处于活动状态时提交附加任务,则在有可用线程之前,附加任务将在队列中等待。如果在关闭前的执行期间由于失败而导致任何线程终止,那么一个新线程将代替它执行后续的任务(如果需要)。在某个线程被显式地关闭之前,池中的线程将一直存在。<br style="line-height:25px"> 参数:<br style="line-height:25px"> nThreads-池中的线程数<br style="line-height:25px"> threadFactory-创建新线程时使用的工厂<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的线程池<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果threadFactory为null<br style="line-height:25px"> IllegalArgumentException-如果nThreads&lt;=0<br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ExecutorService<span style="line-height:25px"></span><span style="color:#ff6600; line-height:25px">newSingleThreadExecutor()</span><wbr style="line-height:25px"><br style="line-height:25px"> 创建一个使用单个worker线程的Executor,以无界队列方式来运行该线程。<br style="line-height:25px"> (注意,如果因为在关闭前的执行期间出现失败而终止了此单个线程,那么如果需要,一个新线程将代替它执行后续的任务)。<br style="line-height:25px"> 可保证顺序地执行各个任务,并且在任意给定的时间不会有多个线程是活动的。<br style="line-height:25px"> 与其他等效的newFixedThreadPool(1)不同,可保证不能对ThreadPoolExecutor重新进行配置来使用更多的线程。<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的单线程Executor<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">1:<span style="color:#339966; line-height:25px">newSingleThreadExecutor</span><span style="color:#000080; line-height:25px">与</span><span style="color:#008000; line-height:25px">newFixedThreadPool(</span><span style="color:#ff6600; line-height:25px">1</span><span style="color:#008000; line-height:25px">)</span><span style="color:#000080; line-height:25px">不同之出在于:<br style="line-height:25px"> newSingleThreadExecutor返回的ExcutorService在析构函数finalize()会调用shutdown(),即如果我们没有对它调用shutdown(),那么可以确保它在被回收时调用shutdown()来终止线程。</span><br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">2:源码如下:<br style="line-height:25px"><span style="color:#0000ff; line-height:25px"></span><span style="color:#993300; line-height:25px">publicstatic</span><span style="color:#0000ff; line-height:25px">ExecutorService</span><span style="color:#ff6600; line-height:25px">newSingleThreadExecutor</span><span style="color:#0000ff; line-height:25px">(){<br style="line-height:25px"> returnnewFinalizableDelegatedExecutorService<br style="line-height:25px"> (newThreadPoolExecutor(1,1,0L,TimeUnit.MILLISECONDS,newLinkedBlockingQueue&lt;Runnable&gt;()));<br style="line-height:25px"> }</span><br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span><span style="line-height:25px"></span>ExecutorService<span style="color:#339966; line-height:25px"></span><span style="color:#ff6600; line-height:25px">newSingleThreadExecutor</span><span style="color:#339966; line-height:25px">(</span>ThreadFactorythreadFactory)<wbr style="line-height:25px"><br style="line-height:25px"> 创建一个使用单个worker线程的Executor,以无界队列方式来运行该线程,并在需要时使用提供的ThreadFactory创建新线程。与其他等效的newFixedThreadPool(1,threadFactory)不同,可保证不能对ThreadPoolExecutor重新进行配置来使用更多的线程。<br style="line-height:25px"> 参数:<br style="line-height:25px"> threadFactory-创建新线程时使用的工厂<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的单线程Executor<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果threadFactory为null <div style="line-height:25px">注意:<span style="color:#000080; line-height:25px">newSingleThreadExecutor返回的ExcutorService在析构函数finalize()会调用shutdown(),即如果我们没有对它调用shutdown(),那么可以确保它在被回收时调用shutdown()来终止线程。</span> </div> <div style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ExecutorService<span style="color:#ff6600; line-height:25px">newCachedThreadPool()</span><wbr style="line-height:25px"><br style="line-height:25px"> 创建一个可根据需要创建新线程的线程池,但是在以前构造的线程可用时将重用它们。对于执行很多短期异步任务的程序而言,<br style="line-height:25px"> 这些线程池通常可提高程序性能。调用execute将重用以前构造的线程(如果线程可用)。<br style="line-height:25px"> 如果现有线程没有可用的,则创建一个新线程并添加到池中。终止并从缓存中移除那些已有60秒钟未被使用的线程。<br style="line-height:25px"> 因此,长时间保持空闲的线程池不会使用任何资源。<br style="line-height:25px"> 注意,可以使用ThreadPoolExecutor构造方法创建具有类似属性但细节不同(例如超时参数)的线程池。<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的线程池<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">1:它没有core线程。源码如下:<br style="line-height:25px"><span style="color:#0000ff; line-height:25px"></span><span style="color:#993300; line-height:25px">publicstatic</span><span style="color:#0000ff; line-height:25px">ExecutorService</span><span style="color:#ff6600; line-height:25px">newCachedThreadPool()</span><span style="color:#0000ff; line-height:25px">{</span></wbr></wbr></wbr></div> <div style="line-height:25px"> <span style="color:#993300; line-height:25px">returnnew</span><span style="color:#0000ff; line-height:25px">ThreadPoolExecutor(</span><span style="color:#339966; line-height:25px">0</span><span style="color:#0000ff; line-height:25px">,</span><span style="color:#008000; line-height:25px">Integer.MAX_VALUE</span><span style="color:#0000ff; line-height:25px">,60L,TimeUnit.SECONDS,newSynchronousQueue&lt;Runnable&gt;());<br style="line-height:25px"> }</span><br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ExecutorService<span style="color:#ff6600; line-height:25px">newCachedThreadPool</span>(ThreadFactorythreadFactory)<wbr style="line-height:25px"><br style="line-height:25px"> 创建一个可根据需要创建新线程的线程池,但是在以前构造的线程可用时将重用它们,并在需要时使用提供的ThreadFactory创建新线程。<br style="line-height:25px"> 参数:<br style="line-height:25px"> threadFactory-创建新线程时使用的工厂<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的线程池<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果threadFactory为null<br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ScheduledExecutorService<span style="color:#ff6600; line-height:25px">newSingleThreadScheduledExecutor()</span><wbr style="line-height:25px"><br style="line-height:25px"> 创建一个单线程执行程序,它可安排在给定延迟后运行命令或者定期地执行。<br style="line-height:25px"> (注意,如果因为在关闭前的执行期间出现失败而终止了此单个线程,那么如果需要,一个新线程会代替它执行后续的任务)。<br style="line-height:25px"> 可保证顺序地执行各个任务,并且在任意给定的时间不会有多个线程是活动的。<br style="line-height:25px"> 与其他等效的newScheduledThreadPool(1)不同,可保证不能对ScheduledThreadPoolExecutor重新进行配置来使用更多的线程。<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的安排执行程序<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">1:<span style="color:#000080; line-height:25px">newSingleThreadScheduledExecutor与newScheduledThreadPool(1)不同之出在于:<br style="line-height:25px"> newSingleThreadScheduledExecutor在析构函数finalize()会调用shutdown(),即如果我们没有对它调用shutdown(),那么可以确保它在被回收时调用shutdown()来终止线程</span>。<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">源码如下</wbr></span><wbr style="line-height:25px">:<span style="color:#993300; line-height:25px">publicstatic</span><span style="color:#0000ff; line-height:25px">ScheduledExecutorService</span><span style="color:#ff6600; line-height:25px">newSingleThreadScheduledExecutor()</span><span style="color:#0000ff; line-height:25px">{<br style="line-height:25px"> returnnewDelegatedScheduledExecutorService<br style="line-height:25px"> (newScheduledThreadPoolExecutor(1));</span><br style="line-height:25px"> }<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">2:这里的<span style="color:#000080; line-height:25px">ScheduledThreadPoolExecutor是core线程固定,且只有core线程,它的队列是无界的。</span><br style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ScheduledExecutorService<span style="color:#ff6600; line-height:25px">newSingleThreadScheduledExecutor</span>(ThreadFactorythreadFactory)<br style="line-height:25px"> 创建一个单线程执行程序,它可安排在给定延迟后运行命令或者定期地执行。<br style="line-height:25px"> (注意,如果因为在关闭前的执行期间出现失败而终止了此单个线程,那么如果需要,一个新线程会代替它执行后续的任务)。<br style="line-height:25px"> 可保证顺序地执行各个任务,并且在任意给定的时间不会有多个线程是活动的。与其他等效的newScheduledThreadPool(1,threadFactory)不同,可保证不能对ScheduledThreadPoolExecutor重新进行配置来使用更多的线程。<br style="line-height:25px"> 参数:<br style="line-height:25px"> threadFactory-创建新线程时使用的工厂<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的安排执行程序<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果threadFactory为null<br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ScheduledExecutorService<span style="color:#ff6600; line-height:25px">newScheduledThreadPool</span>(intcorePoolSize)<wbr style="line-height:25px"><br style="line-height:25px"> 创建一个线程池,它可安排在给定延迟后运行命令或者定期地执行。<br style="line-height:25px"> 参数:<br style="line-height:25px"> corePoolSize-池中所保存的线程数,即使线程是空闲的也包括在内。<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的安排线程池<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果threadFactory为null<br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ScheduledExecutorService<span style="color:#ff6600; line-height:25px">newScheduledThreadPool</span>(intcorePoolSize,ThreadFactorythreadFactory)<wbr style="line-height:25px"><br style="line-height:25px"> 创建一个线程池,它可安排在给定延迟后运行命令或者定期地执行。<br style="line-height:25px"> 参数:<br style="line-height:25px"> corePoolSize-池中所保存的线程数,即使线程是空闲的也包括在内<br style="line-height:25px"> threadFactory-执行程序创建新线程时使用的工厂<br style="line-height:25px"> 返回:<br style="line-height:25px"> 新创建的安排线程池<br style="line-height:25px"> 抛出:<br style="line-height:25px"> IllegalArgumentException-如果corePoolSize&lt;0<br style="line-height:25px"> NullPointerException-如果threadFactory为null<br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ExecutorService<span style="color:#ff6600; line-height:25px">unconfigurableExecutorService</span>(ExecutorServiceexecutor)<wbr style="line-height:25px"><br style="line-height:25px"> 返回一个将所有已定义的ExecutorService方法委托给指定执行程序的对象,这样就无法使用强制转换来访问其他的方法。<br style="line-height:25px"> 这提供了一种可安全地“冻结”配置并且不允许调整给定具体实现的方法。<br style="line-height:25px"> 参数:<br style="line-height:25px"> executor-底层实现<br style="line-height:25px"> 返回:<br style="line-height:25px"> 一个ExecutorService实例<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果executor为null<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意:</wbr></span>它的目的是只暴露ExecutorService接口方法,使特定于实现的方法不可访问。它是通过一个类来包装executor来实现的,该类实现了ExecutorService接口。具体来说只是调用executor的相应函数。具体可以查阅源码。<br style="line-height:25px"><wbr style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ScheduledExecutorService<span style="color:#ff6600; line-height:25px">unconfigurableScheduledExecutorService</span>(ScheduledExecutorServiceexecutor)<wbr style="line-height:25px"><br style="line-height:25px"> 返回一个将所有已定义的ExecutorService方法委托给指定执行程序的对象,这样就无法使用强制转换来访问其他的方法。。这提供了一种可安全地“冻结”配置并且不允许调整给定具体实现的方法。<br style="line-height:25px"> 参数:<br style="line-height:25px"> executor-底层实现<br style="line-height:25px"> 返回:<br style="line-height:25px"> 一个ScheduledExecutorService实例<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果executor为null<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">:其目的和unconfigurableExecutorService相似。<br style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ThreadFactory<wbr style="line-height:25px"><span style="color:#ff6600; line-height:25px">defaultThreadFactory<wbr style="line-height:25px">()</wbr></span><br style="line-height:25px"> 返回用于创建新线程的默认线程工厂。此工厂创建同一ThreadGroup中Executor使用的所有新线程。<br style="line-height:25px"> 如果有SecurityManager,则它使用System.getSecurityManager()组来调用此defaultThreadFactory方法,其他情况则使用线程组。<br style="line-height:25px"> 每个新线程都作为非守护程序而创建,并且具有设置为Thread.NORM_PRIORITY中较小者的优先级以及线程组中允许的最大优先级。<br style="line-height:25px"> 新线程具有可通过pool-N-thread-M的Thread.getName()来访问的名称,其中N是此工厂的序列号,M是此工厂所创建线程的序列号。<br style="line-height:25px"> 返回:<br style="line-height:25px"> 线程工厂<br style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>ThreadFactory<span style="color:#ff6600; line-height:25px"><wbr style="line-height:25px">privilegedThreadFactory<wbr style="line-height:25px">()</wbr></wbr></span><br style="line-height:25px"> 返回用于创建新线程的线程工厂,这些新线程与当前线程具有相同的权限。此工厂创建具有与defaultThreadFactory()相同设置的线程,<br style="line-height:25px"> 新线程的AccessControlContext和contextClassLoader的其他设置与调用此privilegedThreadFactory方法的线程相同。可以在AccessController.doPrivileged(java.security.PrivilegedAction)操作中创建一个新privilegedThreadFactory,设置当前线程的访问控制上下文,以便创建具有该操作中保持的所选权限的线程。<br style="line-height:25px"><span style="line-height:25px"><wbr style="line-height:25px">注意</wbr></span><wbr style="line-height:25px">,虽然运行在此类线程中的任务具有与当前线程相同的访问控制和类加载器,但是它们无需具有相同的ThreadLocal<br style="line-height:25px"> 或InheritableThreadLocal值。如有必要,使用ThreadPoolExecutor.beforeExecute(java.lang.Thread,java.lang.Runnable)<br style="line-height:25px"> 在ThreadPoolExecutor子类中运行任何任务前,可以设置或重置线程局部变量的特定值。<br style="line-height:25px"> 另外,如果必须初始化worker线程,以具有与某些其他指定线程相同的InheritableThreadLocal设置,<br style="line-height:25px"> 则可以在线程等待和服务创建请求的环境中创建自定义的ThreadFactory,而不是继承其值。<br style="line-height:25px"> 返回:<br style="line-height:25px"> 线程工厂<br style="line-height:25px"> 抛出:<br style="line-height:25px"> AccessControlException-如果当前访问控制上下文没有获取和设置上下文类加载器的权限。<br style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>&lt;T&gt;Callable&lt;T&gt;<span style="color:#ff6600; line-height:25px"><wbr style="line-height:25px">callable</wbr></span><wbr style="line-height:25px">(Runnabletask,Tresult)<br style="line-height:25px"> 返回Callable对象,调用它时可运行给定的任务并返回给定的结果。这在把需要Callable的方法应用到其他无结果的操作时很有用。<br style="line-height:25px"> 参数:<br style="line-height:25px"> task-要运行的任务<br style="line-height:25px"> result-返回的结果<br style="line-height:25px"> 返回:<br style="line-height:25px"> 一个callable对象<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果task为null<br style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>Callable&lt;Object&gt;<span style="line-height:25px"><wbr style="line-height:25px"></wbr></span><span style="color:#ff6600; line-height:25px">callable</span><wbr style="line-height:25px">(Runnabletask)<br style="line-height:25px"> 返回Callable对象,调用它时可运行给定的任务并返回null。<br style="line-height:25px"> 参数:<br style="line-height:25px"> task-要运行的任务<br style="line-height:25px"> 返回:<br style="line-height:25px"> 一个callable对象<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果task为null<br style="line-height:25px"><span style="color:#993300; line-height:25px">publicstatic</span>Callable&lt;Object&gt;<span style="color:#ff6600; line-height:25px"><wbr style="line-height:25px">callable</wbr></span><wbr style="line-height:25px">(PrivilegedAction&lt;?&gt;action)<br style="line-height:25px"> 返回Callable对象,调用它时可运行给定特权的操作并返回其结果。<br style="line-height:25px"> 参数:<br style="line-height:25px"> action-要运行的特权操作<br style="line-height:25px"> 返回:<br style="line-height:25px"> 一个callable对象<br style="line-height:25px"> 抛出:<br style="line-height:25px"> NullPointerException-如果action为null<br style="line-height:25px"></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr> </div> </wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值