Summary and Induction of JAVA interview questions of Niuke Network (1), Niuke java

Source: Internet
Author: User

Summary and Induction of JAVA interview questions of Niuke Network (1), Niuke java
Preface

Today, I saw an article on explaining the Spring framework in the Nuggets. The article mentioned Niu Ke's interview questions. As a result, I downloaded the Niuke web app and found that there are many interview questions. I picked out the java interview questions for a moment. Ten questions are a group of interview questions. After completing these questions, I found that I had many mistakes, most of which were basic questions. As the saying goes: the depth of the Foundation determines the height of the future. I feel that I have to sum up and summarize a wrong question. I just took this opportunity to review the missing knowledge points in the java learning process. At the same time, I also think that the theoretical knowledge is also very important. The theory influences the idea and supports the quality of code.

Incorrect question Induction
  • 1st questions

    Write the image description here

    Summary:
    • 1. The method name must be the same as the class name
    • 2. Do not declare the return type
    • 3. the constructor can be modified by final and private.
    • 4. At least one constructor exists in a class.
    • 5. If the class does not provide a constructor with parameters, Java calls a constructor without parameters by default.
  • 2nd questions

    Write the image description here

    Induction

    :

    • 1. The super keyword is used only when the subclass calls a method inherited from the parent class in the Override parent class method.
    • 2. Subclass calls the method inherited from the parent class. You can directly call the method without using the super keyword.
  • 3rd questions

    Write the image description here

    This question is easy to go wrong without looking at it carefully. I think it is very simple and it must be 4. In fact, the correct answer is 10 because break is missing and cannot be jumped out.

    Summary:
  • 4th questions

    Write the image description here

    Summary:

    Answer:

    First, str0 and str1 are static constants stored in the permanent generation of heap memory. Str2 is also a new object, because the source code of substring is actually a new String object and is returned. str3 and str4 directly create new objects through the new operator. Str2, str3, and str4 are young generations stored in the heap zone. After Full GC, the memory of the old generation is cleared and recycled. If it is not a permanent generation, only the young generation is left. So the young generation is 5*3 = 15 characters

  • 5th questions

    Write the image description here

    Summary:
    • The difference between the default package and protected: the former rejects access as long as it is an external package. The latter can be accessed as long as it is a subclass, and the real-time subclass is in an external package.
  • 6th questions

    Write the image description here

    Summary:
  • 7th questions

    Write the image description here

    Answer:

    Answer:

    Dst = new String (src, "GBK"). getBytes ("UTF-8 ");

    Summary:
    • First through the new String (src, "GBK") to restore a String object, in the call String object getBytes ("UTF-8") to obtain the UTF-8 encoded byte array
  • 8th questions

    Write the image description here

    Summary:
  • 9th questions

    Write the image description here

    Summary:
    • Java does not allow programmers to overload operators. If "+" is a string, it is considered a connection string. If "+" is a string and "+" is a basic data type, it is considered a connection. If "+" is a basic data type, it is considered as an addition operation. If "+" is followed by a reference type variable, the toString () method of the object will be called.
  • 10th questions

    Write the image description here

    Summary:
    • Streaming media is a technology that enables audio, video, and other multimedia information to be played over the Internet and Intranet (within the enterprise network) without the need to download and wait.
Finyan

Stick to keeping some missing basic knowledge points updated every day.

 

Join the study exchange group 569772982 to learn and exchange.

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.