Dark Horse programmer _ Java learning experience

Source: Internet
Author: User


-------------------- Android training, Java training, and hope to communicate with you! ---------------------

As the first Java study note, I think it is necessary to talk about my knowledge about Java.

First of all, Java, as a cross-platform programming tool, uses a virtual machine running mode that is separated from the collective platform, to provide developers with a unified development environment, to achieve a compilation of the world. due to this mechanism, I think the operating system should use Java to design the operating system into a virtual machine. The hardware layer is completely shielded by the operating system, including the CPU instruction set, the operating system provides unified external interfaces, including hardware interfaces and CPU command interfaces. similar to virtual machines such as Vm and vritualbox, a single virtual machine is different from this one. The upper layer adopts a unified command interface, and the compiler compiles the commands provided by the operating system, which are executed by the operating system, in this way, all languages can be compiled and run on the entire platform. except for the operating system. in this way, the operating system is equivalent to a Java virtual machine.

Second, Java is the first language I have come into contact with, so I have a few questions about Java. java's data and methods are encapsulated. When a new object is added, the data in this object is independent. But does the method also occupy the memory of every object? Because the C language function only has one copy in the memory, the memory usage is relatively reduced. I wonder if the Java method only stores one copy in the memory. in Java Exception Handling, does this exception violate the encapsulation principle? These questions need to be learned to be improved gradually.

Another problem I want to know is that Java uses a virtual machine for one compilation and runs everywhere. however, not long ago, I compiled a Java program on the PC and packed it into a mobile phone, but it couldn't run. Isn't this against the Java design principles? Is it rare that mobile platforms and PC platforms cannot be used universally?

Compared with the previous languages, the tools provided by Java are indeed very convenient, and the processing of strings and guis is very convenient, but the Java flexibility is not very strong. for example, I used to use hexadecimal conversions.

void hex(int num){      if(num!=0){          hex(num>>4);          putchar("0123456789ABCDEF"[num&0xF]);      }      else         putchar('0');}

It is very troublesome to use Java. First, a Java string is an object instead of a character array. of course, these Java internal methods are provided. however, other problems of the same type are not so flexible.

-------------------- Android training, Java training, and hope to communicate with you! ---------------------- For details, please refer to: http://edu.csdn.net/heima
<

 

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.