Notes (4/11-4/12) Java basics

Source: Internet
Author: User

NAVICAT connection Oracle Cannot load OCI dll,126

DLL file missing, tool-> option->oci->oci Library


Non-static methods and variables must be dependent on the existence of object instances and cannot be accessed directly through class names, and static and static methods can


Runtime.getruntime (). Availableprocessors () Number of CPUs that the JVM can use

Runtime.getruntime (). Freememory () free memory in the JVM

Total memory in the Runtime.getruntime (). TotalMemory () JVM (the maximum value you are trying to use)

JVM Memory relative Unit bytes (byte)


File.listroots () Get the disks on the machine

File.getfreespace Get free Space Unit byte (bytes)

File.gettotalspace Get Total space unit byte (bytes)


SimpleDateFormat date format DecimalFormat number format


Eclipse modulation format wide distance preferences->java->code style->formatter->new


public enum Minaclass {
Applyagent ("xxx"),
Scriptentry ("xxx"),
Scriptexecute ("xxx");


Private String ClassName;


Minaclass (String className) {
This.classname = ClassName;
}


Public String GetClassName () {
return className;
}


public void Setclassname (String className) {
This.classname = ClassName;
}

public static void Main (String args[]) {
Minaclass xclass=minaclass.applyagent;
int x=1;
}


}




Applyagent ("xxx"),
Scriptentry ("xxx"),
Scriptexecute ("xxx");
These three pieces of code are equivalent to initializing three constructs, which can be generated directly by the class name. XX, and because the constructor method is not set to modify the permissions
The default permissions are private, which is equivalent to providing only three methods of generating the class to the outside.


Class if no write access modifier is friendly (only classes in this class and in the same package can be accessed, others have no access)
The method does not write access modifiers are private (only used in this class, no other)


Switch (' 1 ') {case
        ' 1 ': Case
        ' 2 ': Case
        ' 3 ':
          System.out.println ("1");
          break;
		

Equivalent to only meet the ' 1 ', ' 2 ', ' 3 ' Output 1;

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.