java void and void uppercase V and lowercase V

Source: Internet
Author: User
Tags lowercase
    private void InitValue () {
        phonestring = Phonefield.gettext (). toString (). Trim ();

    }

    Private class Requestgetposttask extends Asynctask<void, void, void>{

        @Override
        protected void Doinbackground (Void ... params) {return
            null;
        }

    }

Look at the code above:

Void is a method return value type

Void can be used as a class

Void x = Null;//correct

Void is generally used as a parameter type

protected void Doinbackground (void ... params) {
return null;
}

    Void is also the return type here, why?

If you want a method to return a type that is always null, you can place the return type as void

Void is an automatic boxing type void (autoboxing feature) (since JDK 1.5)

 Void function (int a, int b) {
    //do something return
    null;
 }
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.