] View plaincopypublic class Test2 {public static void Main (String args[]) {StringBuilder s = new StringBuilder ("Hello");System.out.println (s);Foo (s);System.out.println (s);}public static void Foo (StringBuilder s) {s = new StringBuilder ("World");}}What about this time? Will you output "Hello" and then output "world"? No, it's still two times "Hello".Suffice to say that this problem is not related to the immutable characteristic of string. Whether it's a immutable type or a generic type, th
1. What is a Java virtual machine? Why is Java called a "platform-agnostic programming language"?A Java Virtual machine is a virtual machine process that can execute Java bytecode. The Java source file is compiled into a bytecode
PrefaceWhether you are a newbie or an expert in programming, you will be amazed by the Infinite Charm of Sun's Java. Java brings you more than just the advantages of object-oriented, open, platform-independent, easy-to-use, secure, and "Write once, run anywhere" software development. More importantly, it provides a novel way of expressing ideas and a brand new wa
difference between stack and stack.
The storage method is shown in:
Image Source
To be continued .....
Java FAQ
Download a java interview book online with comprehensive questions.What are the correct answers to common Java programming interview questions?
First, let's ta
objectParsing: The Java language is capable of supporting multithreaded programming, encapsulating threads into objects of type thread, as long as the thread-type object is created, it is easy to start threads and execute thread bodies. Programmers must first master the common methods of creating threads.Reference answer: The Java language often uses two methods
The Java Collection Framework is the most frequently asked question of Java interviewing, and it is necessary to understand the powerful features of Java technology to master the set framework. Here are some practical questions, often asked in the core Java interview.1. Wh
Java interview questions
Basic knowledge:1. simple principles and applications of the Exception Handling Mechanism in C ++ or Java.
When a Java program violates the Java Semantic Rules, the Java Virtual Machine will indicate an er
Stringbuilder:stringbuilder is mutable, which means that you can also modify its value after you create the object. StringBuilder vs Stringbuffer:stringbuffer is synchronous, meaning it is thread-safe, but it will be slower than StringBuilder.8. How to construct a string quickly and repeatedly? In Python programming, you just have to multiply the string by a number to get it done, and in Java
) Select the correct collection type as needed. For example, if you specify a size, we will choose an array instead of a ArrayList. If we want to traverse a map in order of insertion, we need to use TreeMap. If we don't want to repeat, we should use set.(2) Some collection classes allow you to specify the initial capacity, so if we can estimate the number of stored elements, we could use it to avoid re-hashing or resizing.(3) programming based on inte
TreeMap. If we don't want to repeat, we should use set.(2) Some collection classes allow you to specify the initial capacity, so if we can estimate the number of stored elements, we could use it to avoid re-hashing or resizing.(3) programming based on interfaces, rather than implementation-based programming, allows us to easily change the implementation later.(4) Always use type-safe generics to avoid clas
verification) We understand the role of this module as a facet, telling us that it is a functional module. We can think of it as a facet. To put it bluntly, we write a class. Write a method in this class that deals with the same effect in the core business.We also need to know two keyword: connection point (Joinpoint), a simple understanding is the method defined in the tangent module. Is the method in the definition class above. pointcut (Pointcut). Is the collection of connection points, whic
overloading.
25th, can you inherit the string class?
The string class is a final class and therefore cannot be inherited.
26th, when a thread enters an synchronized method of an object, can other threads enter other methods of this object?
No, one synchronized method of an object can only be accessed by one thread.
27th, there is a return statement in try {}, so will the code in the finally {} after this try be executed, when it is executed, before or after it?
Will execute, before return.
Android development interview: 4. Common basic Java questions, androidjava
Follow finddreams blog: http://blog.csdn.net/finddreams/article/details/44403041Because Android is programmed using the Java language, it is necessary for us to fully master the Java foundation for Android development. During the interview, we
I. Basic knowledgeJava Collection FrameworkWhat is a 1.Java set frame? What are some of the advantages of a collection framework?There are collections in each programming language, and the original Java version contains several collection classes: Vector, Stack, Hashtable, and array.With the extensive use of the collection, Java1.2 proposes a collection framework
What is a 1.Java set frame? What are some of the advantages of a collection framework?There are collections in each programming language, and the original Java version contains several collection classes: Vector, Stack, Hashtable, and array. With the extensive use of the collection, Java1.2 proposes a collection framework that encompasses all the set interfaces,
Java Questions Answers
1. What is the difference between an applet and an application?
A Java application is made up of a main () method declared as public static void that accepts a string array argument, along with any other classes that main () CILS. it lives in the environment that the Host OS provides.
A Java a
Test your Java basic test questions:
This is a few interview questions I designed. The requirement is that there should be as few questions as possible and they can be completed within five minutes, but it can basically reflect the level of knowledge of the interviewer. So I designed six questions.If you are able to fi
One, what is a thread?A thread is the smallest unit that the operating system can perform operations on, which is included in the process and is the actual operating unit of the process. Programmers can use it for multiprocessor programming, and you can speed up operations-intensive tasks using multithreading. For example, if a thread takes 100 milliseconds to complete a task, it takes 10 milliseconds to complete the task with 10 threads.Ii. What is t
of reflection, how to optimize?Definition of reflection mechanism:is in the running state, for any one class, can know all the properties and methods of this class, any object can be invoked through the reflection mechanism of a class of any method, the dynamic acquisition of class information and the function of dynamic call class object method is called Java reflection mechanism.The effect of reflection:1. Dynamically create an instance of the clas
return statement in try {}, so will the code in finally {} following this try be executed? When will it be executed, before or after return?
Will be executed, before return.
28th. Programming question: how many equals 2x8 in the most efficient way?
Programmers with a C background are particularly fond of asking such questions.
29th, the two objects have the same value (X. Equals (y) = true), but diffe
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.