What are the differences between Java and Python?

Source: Internet
Author: User
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content: The market is different, depending on the company's staff, the company is large, the project is large, there are many people, the flow is large, Java, because of the norms, the old man is easy to take over after a new person.
Small companies, few people, small projects, positive employees, less frequent substitution of people, python, so the project progress is too low. Java is a High-level programming language, and Python is a very advanced language (very-high-level language [1]).
[1]: http://docs.python.org/tutorial/appetite.html After JAVA introduces a package, the method of calling the package is simpler than that of Python, while the Python direct import package is explicit, so there will be no conflict between modules/classes of the same name, if "from module import function" is used, the function must be referenced in a targeted manner.
JAVA blocks are enclosed in braces. Python is represented by colons and four spaces.
The JAVA type must be declared, and the Python type is not required.
JAVA is basically a class/structure operation, that is, object-oriented processing. Python can use an independent function module to process logic without putting it into the class.
Each line of JAVA statements ends with a semicolon. in Python, you can leave it empty.
Strings in JAVA are enclosed in double quotation marks. in Python, single quotation marks or double quotation marks are acceptable (the same as JavaScript ).
When the same function is implemented, JAVA usually requires more keyboard times than Python.

... Python is also a strong type.
The strength type does not mean whether the type needs to be defined, but whether the type can be converted at will once determined.

The differences between Java and Python are static and dynamic types. static types must be declared before use, and dynamic types do not need to be declared. I will say that most people who have finished learning Python will not like learning Java...
  • Python syntax is more concise
A complete Python HelloWorld program requires only one line of code:

print("Hello World")
Appeared in 1995
I am still familiar with the brackets and the ending comma... This is a problem .. Differences
I. python virtual machines are not strong in java, and java virtual machines are the core of java. The core of python is that c functions or c ++ libraries can be easily used.

II. python is completely dynamic. you can modify your own code at runtime. java can only be implemented through work und. Python variables are dynamic, while java variables are static and need to be declared in advance. Therefore, the code prompt function of java ide is better than that of python ide.

3. python has been produced for decades and has been a mainstream process for decades. Therefore, many python programs use process-oriented design methods and many concepts come from the C language, class is added later in python, while java is used to implement c ++ without pointers (reference records used by com components in the past, virtual machines used by java ), we mainly use object-oriented design methods, many of which are oop concepts. Process-oriented, relatively concise and intuitive, but easy to design noodle programs, object-oriented, relatively abstract and elegant, but easy to over-abstract.

4. it is easy to get started with python in practice, but to learn how to work with python, you need to learn more about various python libraries. the strength of pyhton lies in the library. why is the python library powerful, the reason is that the python library can be designed using python, c language, c ++, and so on, and then provided for python. therefore, no matter gpu running, neural networks, intelligent algorithms, data analysis, and image processing, scientific Computing, a variety of libraries are waiting for you to use. Java does not have as many open-source libraries as python. many libraries are used internally by commercial companies, or are released as a jar package, so you cannot see the original code. The python virtual machine does not support java compilation (or is designed intentionally). Generally, the source code (linux) is used directly, or the source code is simply packaged (such as pyexe ).

5. python has many virtual machine implementations, such as cython, Pyston, pypy, jython, and IronPython. it is suitable for use in business languages, plug-ins, or domain-oriented languages. java has a huge number of virtual machines, it is rarely used in plug-in languages, and release is not convenient.

6. java is mainly used in fields with strong commercial logic, such as mall systems, erp, oa, finance, insurance, and other traditional database transaction fields. through the transaction code similar to the ssh framework, such as oralce, db2, and SQL server, which have good support and strong software engineering concepts and are suitable for the multi-person development mode of software engineering. Python is mainly used for web data analysis, scientific computing, financial analysis, signal analysis, image algorithms, mathematical computing, statistical analysis, algorithm modeling, server O & M, automated operations, and fast development, suitable for quick development teams or individual Agile models.

7. many java commercial companies are supported, such as sap, oracle, ibm, and commercial containers, middleware, and enterprise framework ejb. Python supports many open-source organizations, such as qt, linux, and google. many open-source programs support python, such as pyqt, redis, and spark.

8. scripts are the most used in python, web is the most used in java, and pyhotn is glue. it can be used together to stick all kinds of irrelevant things. java is the foundation, you can use software engineering to build a team of several hundred people and compete with you. However, I think python is powerful because it can easily call c or c ++ libraries, but software engineering and commercial operations are not as good as java and are suitable for quick development.

9. about money.

If you want to write programs to sell software in java, you can use ibm servers, oracle databases, and emcstorage. The price is high, and commercial purchasing companies like this kind of height. If you want to directly use a program to generate money using python, python can implement loose finance, data retests, stock trading, stock speculation, stock speculation, gold speculation, Bitcoin speculation, hedging arbitrage, and statistical arbitrage, there are many open-source libraries, data analysis libraries, and machine learning libraries for reference.

10. both java and python can run on the linux operating system. However, many linux systems support python native and java needs to be installed on their own. The reason why java and python are better than c # is that they support linux, osx, unix, and arm. Java and python are more popular than c ++ because pointers are not needed.

11. for mobile Internet, python can only run on Android or ios through the runtime library. java Native supports Android development, but cannot use ios.

12. for big data, hadoop is developed in java, spark is developed in Scala, and it is more convenient to use python to call spark for further analysis.

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.