Java Features interview questions:

Source: Internet
Author: User

1. Briefly describe the robustness of Java programs.

A: The Java program will automatically detect errors at compile and run time, and it is a strongly typed language, strict for type checking, and its garbage collection mechanism effectively avoids memory leaks.

2. Why is the Java language completely object-oriented? (Actually I don't think it's completely object-oriented.)

A: Because it does not support any process-oriented program design technology, all of its programming techniques are implemented using classes.

Another: Because it has 8 simple data types that are not object-oriented and can be used directly, a variable or method declared with static is not object-oriented, because it does not belong to any object, and it can be used directly to invoke it without instantiating it (this method is still in dispute).

3. A brief introduction to how Java implements security.

A: First Java removes the pointer this avoids the illegal memory operation, all the memory operation must pass through the object instance to implement. And when we download code execution from the web it is its security system that ensures that malicious programs do not casually access resources on our local computer.

4. Why is Java interpreted?

A: Because when we execute a Java file, the compiler first translates the code into a bytecode file, which is an intermediate code that is then executed by the Java interpreter.

5. A brief introduction to the platform-agnostic nature of Java.

A: The Java program is executed on the virtual machine, as long as the Java Virtual machine is installed it can be executed on any platform in the form of bytecode.

6. A brief description of Java polymorphism.

A: polymorphism refers to different methods of the same name coexist in the program, the system according to different situations call different methods to achieve different functions. There are two ways to achieve polymorphism: override implementation, overload implementation.

7. A brief introduction to Java is a strongly typed check language.

A: Java checks data types very strictly, you must specify their type when defining and using variables, and it allows only the upward elevation of the data type, and does not allow for data loss of the attached value (such as the decimal is attached to shaping).

What is the difference between 8.int and integer?

A: int is a simple data type (shaping) and an integer is a wrapper class for shaping.

9. Briefly describe the differences between string and StringBuffer?

A: The string class represents an immutable string. Cannot be changed after a value has been created. The stringbuffer is a variable sequence of characters with an initial capacity of 16 bytes, which can be changed by some means to its content and length.

10. A brief introduction to Java's garbage collection mechanism.

A: Java's garbage collection mechanism is that when an object does not have any references, the object launches the garbage collector to call the Finalize method to configure system resources or perform related cleanup operations.

1, Object-oriented programming (OOP): The most important idea of OOP is a class, a class is a template, constructs an object from a class, that is to create an instance of this class;

2, encapsulation: is the data and behavior together, and the object of the user to hide data implementation process, usually an object in the data called his instance field (instance field);

3 . Inheritance: Java allows you to build new classes based on existing classes, and when you inherit a class that already exists, you reuse the methods and fields of the class, and you can add new methods and fields to the new class.

4, polymorphism: In Java, the object variable is polymorphic; It is important to note that multiple inheritance is not supported in Java;

5, the relationship between the classes:

    • Use-a: Dependency relationship;

    • Has-a: Aggregation relationship;

    • Is-a: Inheritance Relationship--Example: Class A inherits Class B, when Class A not only has the method of Class B, but also its own method;

6, constructs the object to use the constructor: the constructor is a special method, its function is constructs the object and initializes it,

    • Constructor features: The constructor can have 0, one or more parameters;

    • Constructors and class names are the same;

    • A class can have more than one constructor;

    • The constructor has no return value;

    • The constructor must be used with the new operator;

7, package: Java allows one or more classes together to become a group, said as a package for better management, Standard Java library is divided into many packages such as Java.lang, Java.util, java,net, etc., package is hierarchical, All Java packages are within the Java and javax package hierarchy;

8, overloading: When more than one method has the same name and contains different parameters, then the overload occurs, the compiler will choose which method to call;

9, robust features: Java has adopted a security pointer model, can effectively prevent rewriting memory and data crashes;

10 . Security: Java can be used to build anti-virus and anti-attack system, it turns out that Java is doing better in antivirus;

11, portability: Java in the basic data structure type of size and algorithm are strict rules, so there is very good portability;

12, Multithreading: Because of the Java mechanism, it is very simple process of multithreading, Java to the implementation of multi-threaded to the bottom operating system or threading program, so multithreading is Java as a server-side development of the language of one of the reasons;

13, dynamic binding: This is the Java Call object method mechanism;

14. Each class in Java is extended from the object class;

15 . Inner class: The definition of an inner class is defined in another inner class;

  There is a lot of experience to accumulate in depth or breadth. For example, some areas are very focused/professional, or generally have a very comprehensive understanding and understanding. Long working hours need to have a certain accumulation, or how to highlight their own characteristics? To do the Internet, there is a need for performance, concurrency, distributed and other professional areas have some understanding or research, even some of the experience is good. To do business development needs to the industry, stability, tools, theory and some unique understanding, even if very elementary, naïve also line. Specific point how to say, for example, you use Struts/spring/hibernate/ibatis every day, and so on, then do you know these principles? Do you know the idea behind the industry? And not just know how to invoke the API, which is far from enough. If you can study the source code, write a similar system is better. To be honest is to be able to find some regularity or knowledge through the tool/technology itself, and the rest is accumulation, which is what we usually say about experience. Another aspect is the understanding of industry trends. Technology can not only focus on the technology itself, but also the performance of the dynamic, trends some attention, so as not to keep the technology constantly updated and backward. This is not to say that always pursue new technologies, new software, new tools, etc., but focus on the development of the industry itself. There is also a very important accumulation of experience, that is the ability to solve problems. Many students at the same time feel that they do a lot of things, but let him say one or two points more prominent things, it is not come out, always due to the fact that things are relatively simple, no more discoveries and excavations. In fact, sometimes the interviewer only needs to understand the process of solving the problem, and find out what the individual has done, how to do, and what has been harvested. This is the accumulation of experience. The company ultimately needs to contribute to the work of the staff, so the need for experienced people to help solve the problem, then the ability to solve problems and thinking is very important. For students who do not have much experience, such as a new graduate or an intern, then they need a good foundation and some personal knowledge. These inexperienced Java students generally do not embarrass them, just need to know, realize to tell the interviewer on the line, so that the interviewer can see the potential for development. Many people still like to cultivate those who have the potential to develop students, the progress of these students are very rapid. I personally summarize only a little, that is to have a "bright spot." Frankly speaking is to have their own unique understanding and understanding and so on in many similar students to stand out. Since can not do all-rounder, then do "professionals". These Java find work experience sharing hope to help you find a good job. In short, the interview skill is the basis, the expression is auxiliary. is a piece of gold, where it will shine!  

Java Features interview questions:

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.