In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
The editor of this article introduces in detail "what are big data's Ten basic interview questions". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "what are big data's Ten basic interview questions" can help you solve your doubts. Let's follow the editor's train of thought to learn new knowledge.
1. When an object is passed to a method as a parameter, this method can change the properties of the object and return the changed result, so is it value passing or reference passing? [basic]
A: it's value transfer. The Java programming language only passes parameters by values. When an object instance is passed to a method as a parameter, the value of the parameter is a reference to the object. The content of an object can be changed in the method being called, but the reference to the object will never change.
2. The difference between String and StringBuffer? [fundamentals]
Answer: the JAVA platform provides two classes: String and StringBuffer, which can store and manipulate strings, that is, character data containing multiple characters.
This String class provides a string whose values are immutable.
The string provided by this StringBuffer class is modified. You can use StringBuffer when you know that the character data is about to change. Typically, you can use StringBuffers to dynamically construct character data.
3. The difference between String and StringBuffer StringBuilder. [basic]
Answer: the length of String is immutable; the length of StringBuffer is variable. If you often operate on the contents of a string, especially when the content is to be modified, use StringBuffer, and if you finally need String, use the toString () method of StringBuffer; thread safety; StringBuilder starts with JDK 5 and complements an equivalent class used by a single thread for the StringBuffer class. Generally, the StringBuilder class should be preferred because it supports all the same operations, but because it does not perform synchronization, it is faster.
4. The difference between Overload and Override. Can the method of Overloaded change the type of return value? [base]
A: the rewriting Overriding and overloading Overloading of the method are different manifestations of Java polymorphism. Rewriting Overriding is a manifestation of polymorphism between parent and child classes, and overloading Overloading is a manifestation of polymorphism in a class. If a method is defined in a subclass with the same name and parameters as its parent class, we say that the method is Overriding. When an object of a subclass uses this method, the definition in the subclass is called, and for it, the definition in the parent class seems to be "masked". If multiple methods of the same name are defined in a class, they either have a different number of parameters or have different parameter types, it is called Overloading of the method. The method of Overloaded is that you can change the type of return value.
5. Class An and class B are defined as follows: [basic]
Class A {
Int axi1
Double dudes 2.0
Void show () {
System.out.println ("Class A: a =" + a + "\ td=" + d)
}
}
Class B extends A {
Float axiom 3.0f
String d = "Java program."
Void show () {
Super.show ()
System.out.println ("Class B: a =" + a + "\ td=" + d)
}
}
(1) if you have the following statement in the main method of the application:
An a=new A ()
A.show ()
What is the result of the output?
(2) if the object b of class B is defined in the main method of the application:
A b=new B ()
B.show ()
What is the result of the output?
A: the output result is:
1) Class A: axi1dong2.0
2) Class A: axi1dong2.0
Class B: axiom 3.0 d=Java program.
6. Describe the principle and mechanism of JVM loading class files? [basic]
Answer: class loading in JVM is implemented by ClassLoader and its subclasses, and Java ClassLoader is an important Java runtime system component. It is responsible for finding and loading classes of class files at run time.
7. Is it possible to store a Chinese character in a char variable? Why? [basic]
A: can be defined as a Chinese, because the java is encoded in unicode, a char occupies 16 bytes, so it is no problem to put a Chinese.
8. What's the difference between abstract class and interface? [basic]
A: a class that declares the existence of a method without implementing it is called an abstract class. However, you can create a variable whose type is an abstract class that is used to create a class that reflects some basic behavior and declare methods for the class, but cannot implement the class in the class. You cannot create an instance of an abstract class and point it to an instance of a specific subclass. There can be no abstract constructor or abstract static method. The subclasses of the Abstract class provide implementations for all abstract methods in their parent class, otherwise they are also abstract classes. Instead, implement the method in a subclass. Other classes that know their behavior can implement these methods in the class. The interface (interface) is a variant of the abstract class. A new type of multi-inheritance can be achieved by implementing such an interface. All methods in the interface are abstract and all member variables are publicstatic final. A class can implement multiple interfaces, and when a class implements a special interface, it defines (that is,
Give the program body to) all the methods of this interface. It can then call the methods of the interface on any object of the class that implements the interface. Because of the abstract class, it allows the interface name to be used as the type of the reference variable. The usual dynamic linking will take effect. References can be converted to or from interface types, and the instanceof operator can be used to determine whether an object's class implements an interface.
9. The difference between Static Nested Class and Inner Class? [basic]
A: Static Nested Class is an inner class declared as static, which can be instantiated without relying on external class instances. The usual inner class can only be instantiated after the external class is instantiated.
10. Will there be a memory leak in Java? please briefly describe it. [basic]
Answer: yes; there are useless but reachable objects that cannot be recycled by GC, resulting in memory consumption.
After reading this, the article "what are big data's Ten basic interview questions" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself before you can understand it. If you want to know more about related articles, welcome to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.