current location:Home > Technical Articles > Java > JavaBase
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- How to define interface in java
- The way to define an interface in Java is: Interfaces are usually declared with the interface keyword. An interface is an abstract type in the Java language and a collection of abstract methods. Declaration syntax format: [[modifier] interface interface name {declared variable abstract method}].
- JavaBase 5011 2020-07-11 10:10:09
-
- What is the function of continue statement
- The function of the continue statement is to end the current loop and enter the next loop. That is, only this loop ends, not all loops end, and subsequent loops still continue. The continue statement can only be used in loop statements.
- JavaBase 21877 2020-07-11 09:13:17
-
- Can constructors be inherited in Java?
- Constructors cannot be inherited in Java. When a subclass inherits from a parent class, it first runs the parent class constructor. That is to say, when running the subclass, the parent class's constructor will be called first. Constructors are generally used to initialize member properties and member methods.
- JavaBase 3911 2020-07-09 14:32:01
-
- How to convert string to array in java
- The way to convert a string into an array in Java is through the split method, which splits the string according to matching a given regular expression. Specific usage: [String[] arr = str.split(",")], which means splitting the string with commas and storing it in an array.
- JavaBase 18225 2020-07-09 14:14:17
-
- What command do you need to use to compile a java program?
- To compile a java program you need to use the javac command. The usage method is: 1. Open the command prompt and enter the directory where the Java file is located; 2. Execute the [javac file name.java] command and press Enter. At this time, a class file will be generated in the directory where the Java file is located.
- JavaBase 26056 2020-07-09 13:33:59
-
- What are the Boolean logical operators?
- There are four types of Boolean logical operators, namely: And (logical AND), Or (logical OR), Not (logical negation), and Xor (logical exclusive OR). For logical AND, the result is true only if both operands are true. For logical OR, the result is false only if all operands are false.
- JavaBase 37053 2020-07-06 09:59:42
-
- What does import java.util.* mean?
- [import java.util.*;] is to import the class interface in the java.util package. The function of import in Java is to import the class interface in the package to be used. Import is at the beginning of the java file. Let’s first explain what will be used. Those categories, then we can specify a class in the code using just the class name.
- JavaBase 14177 2020-07-04 15:52:16
-
- What are the four ways to create a thread pool in java
- The four ways to create a thread pool in java are: 1. newCachedThreadPool creates a cacheable thread pool; 2. newFixedThreadPool creates a fixed-length thread pool; 3. newScheduledThreadPool creates a fixed-length thread pool.
- JavaBase 11435 2020-07-04 15:44:43
-
- Check what java version is
- The method to check the java version is: first open the computer desktop, use the shortcut key [win+R] to enter cmd to bring up the window; then enter [java -version] in the window; finally press Enter to view the version.
- JavaBase 4606 2020-07-04 15:10:08
-
- What does extends mean in java
- The role of extends in Java is to inherit. In Java, an existing class is inherited through the keyword extends. The inherited class is called the parent class [super class, base class], and the new class is called a subclass [ Derived classes], and multiple inheritance is not allowed in Java.
- JavaBase 23490 2020-07-03 17:57:27
-
- What is the function of finalize method in java
- The finalize method in java is a method provided in the Object class. Before the GC is ready to release the memory space occupied by the object, it will first call the finalize() method.
- JavaBase 4732 2020-07-03 15:34:34
-
- What are the formats for defining arrays in java?
- The formats for defining arrays in Java are: 1. [int[] arr = new int[5]]; 2. [int[] arr = new int[]{1,2,3,4,5}]. In the Java language, the length (the number of elements in the array) cannot be specified when declaring an array.
- JavaBase 5588 2020-07-03 14:50:02
-
- What is the difference between hashcode and equals?
- The difference between hashcode and equals is: 1. If equals of two objects returns true, hashCode must also return the same int number; 2. If hashCode of two objects returns the same int number, equals does not necessarily return true.
- JavaBase 6132 2020-07-03 12:00:50
-
- Talk about serialization and deserialization in Java objects
- The concepts of serialization and deserialization: The process of converting an object into a byte sequence is called serialization of the object. The process of restoring a sequence of bytes into an object is called deserialization of the object.
- JavaBase 2540 2020-07-03 10:04:38
-
- Can a java class have multiple parent classes?
- A Java class cannot have multiple parent classes, but only one parent class. Java classes only support single inheritance and do not support multiple inheritance, so they can only have one parent class; interfaces can have multiple inheritance, so interfaces can have multiple parent classes.
- JavaBase 12757 2020-07-03 09:40:55