Java object-oriented face question

Source: Internet
Author: User
Tags finally block float double

List of interview questions:

First, Javase common face questions

1, Static and final difference? When you use the final keyword to decorate a variable,
Is the reference immutable, or does the referenced object not change?
2. What is the difference between "= =" and Equals method?
3. What is the difference between a static variable and an instance variable?
4, please say the scope public,private,protected, and do not write when the difference
The visible range of these four scopes is shown in the following table.
5, the difference between overload and override.
6. What are the three basic characteristics of a class? What are the advantages of each feature?
7. What is the mechanism for polymorphism in Java?
8. What is the difference between abstract class and interface?
9. The following statement creates a total of how many objects: String s= "a" + "B" + "C" + "D";
10, the difference between ArrayList and vector,
The difference between HashMap and Hashtable
11, talk about final, finally, finalize the difference
12, String, StringBuffer StringBuilder difference.
13, the difference between Collection and collections?
14, please say Arraylist,vector, LinkedList storage performance and features
15, the difference between HashMap and Hashtable?
16, the Java language how to do exception handling,
Keyword: What does throws,throw,try,catch,finally mean?
Can I throw an exception in a try block?
17.8 Basic types of Java
18. Can I include more than one class (not an inner class) in a ". Java" source file? What are the restrictions?
19. What is Java serialization and how do I implement Java serialization? Or, explain the role of the serializable interface.
20, the advantages and principles of garbage collection. and consider 2 kinds of recycling mechanisms.
21. Is there a memory leak in Java? Please describe it briefly.
22. Please try to describe the GC in the Java language (Gabage Collection)
23, JDK1.5 introduced a number of new language features,
More conducive to writing code, such as support for generics,
Automatic split/boxing, enhanced for loop, etc., please combine code to show examples.
24, Anonymous Inner class (anonymous internal classes)
Whether you can extends (inherit) other classes, whether you can implement
(Implementation) interface (interface)?


25, short S1 = 1; S1 = s1 + 1; what's wrong? Short S1 = 1; S1 + = 1; what's wrong?
26. Can I store a Chinese character in char type?
27. Can the constructor constructor be override?
28, interface can inherit interface? is an abstract class achievable (implements) interface?
Can abstract classes inherit concrete classes (concrete Class)?
Can I have a static main method in an abstract class?

=================== one, javase common face question ==============================

1, Static and final difference? When you use the final keyword to decorate a variable,
Is the reference immutable, or does the referenced object not change?

Static and final differences:
static:static static keywords, adornments: properties, methods, inner classes, code blocks
  static decorated resources belong to class level, resources shared by all object instances
  (properties, method, inner Class)
 1) static property, which uses the static decorated property, is initialized during the load of the class
  is a variable that belongs to the class, an instance of the class, and uses the class name to access the property.
    instance variable: a property that belongs to an object.
 2) The static method, which is a method of the static declaration, a method that belongs to a class, General
  is used to represent a tool method. You can call it yourself after the class is loaded, and you do not need to create any instances of the
  class.
  MATH.SQRT () Math.pow () Math.sin () ...
  integer.tohexstring ()
 3) static code block, which is a block of code that runs during class loading, because the class only loads
  once, so the static code block executes only once!
  usage is not very common, it is generally used to initialize some static resources after class loading
  when used, such as: Load configuration file.
 
 4) static inner class
Final:final final
 1) final decorated class that can no longer be inherited.
 2) The final decorated method, which can no longer be overwritten.
  in the actual project development, the final method is not allowed in principle!
 
 3) Final modified variables, which are not allowed to be modified after initialization.
   A final local variable
   B final method parameter
   c final member variable
 4) final Static--Java makes A variable that is modified with final static as a constant.
    General requirements for constant names have uppercase letters.

When you use the final keyword to decorate a variable, it means that the reference variable does not change.
The contents of the object to which the reference variable is pointing can still be changed.
For example, for the following statement:
Final StringBuffer a=new StringBuffer ("immutable");
Executing the following statement will report a compile-time error:
A=new StringBuffer ("");
However, the following statements can be executed by compiling:
A.append ("broken!");

When someone defines a method's parameters, you might want to block the method from modifying the passed-in Parameter object in the following form:
public void method (final stringbuffer param) {
}
In fact, this cannot be done, and the following code can still be added inside the method to modify the Parameter object:
Param.append ("a");

2. What is the difference between "= =" and Equals method?

Make one thing clear and then another, so that the difference naturally comes out, and it's hard to say what you're saying.
The = = operator is specifically used to compare the values of two variables, that is, whether the value stored in the memory used to compare the variables is the same, to compare two basic types of data or two reference variables equal, only with the = = operator.
If the data that a variable points to is an object type, then this time involves two blocks of memory, the object itself occupies a chunk of memory (heap memory), and the variable occupies a chunk of memory, such as objet obj = new Object (); the variable obj is a memory, and new object () is another memory, At this point, the value stored in the memory of the variable obj corresponds to the first address of the memory that the object occupies. For variables that point to the object type, if you want to compare whether the two variables point to the same object, that is, to see if the values in memory for the two variables are equal, then you need to compare them with the = = operator.
The Equals method is used to compare the contents of two separate objects, as compared to two people whose looks are the same, compared to the two objects that are independent of each other. For example, for the following code:
String A=new string ("foo");
String B=new string ("foo");
Two new statements create two objects, and then use a, B, to point to one of the two variables, which is two different objects, their first address is different, that is, the values stored in a and B are not the same, so the expression a==b will return false, and the contents of the two objects are the same. Therefore, the expression a.equals (b) returns True.

If a class does not define its own Equals method, it inherits the Equals method of the object class, and the implementation code for the Equals method of the object class is as follows:
Boolean equals (Object o) {
return this==o;
}
This means that if a class does not define its own Equals method, its default Equals method (inherited from the object class) is using the = = operator, and whether the object pointed to by the two variables is the same object, using equals and using = = will get the same result. If the comparison is two independent objects, the total return is false. If you are writing a class that wants to compare the contents of the two instance objects created by the class, then you must override the Equals method, and write your own code to determine at what time that the contents of the two objects are the same.


3. What is the difference between a static variable and an instance variable?
The difference between the syntax definitions: static variables to add static keywords,
The instance variable is not added before.
Differences in program run time:
An instance variable belongs to an object's properties, and an instance object must be created.
The instance variable is allocated space before the instance variable can be used.
Static variables are not part of an instance object, but belong to classes, so they are also called class variables.
As long as the program loads the class's bytecode without creating any instance objects, the static variables are allocated space and the static variables can be used. In summary, an instance variable must be created before it can be used by the object, and a static variable can be referenced directly using the class name.
For example, for the following program, no matter how many instance objects are created, only one Staticvar variable is always assigned, and each instance object is created, the Staticvar adds 1; However, each instance object is created, a Instancevar is assigned. That is, multiple instancevar may be assigned, and each Instancevar value is only added 1 times.
public class varianttest{
public static int staticvar = 0;
public int instancevar = 0;
Public Varianttest () {
staticvar++;
instancevar++;
System.out.println ("staticvar="
+ Staticvar + ", instancevar=" + Instancevar);
}
}
Note: This solution in addition to clear the difference between the two, and finally with a specific application examples to illustrate the difference between the two, reflecting their own good explanation of the problem and the ability to design cases, quick thinking, more than the general programmer, have the ability to write!

4, please say scope public,private,protected,
And the difference when it's not written.
The visible range of these four scopes is shown in the following table.
Description: If no access modifiers were written above the decorated element, the default is indicated.

Scope Current class same package subclass other package
Public√√√√
Protected√√√x
Default√√xx
Private√xxx

5, the difference between overload and override.

Overload is overloaded meaning that override is covered by the meaning,
That is, rewriting.
Overloaded overload means that the same class can have
Multiple methods with the same name,
But the parameter lists for these methods are different
(That is, the number of parameters or the type is different).
overriding override means that a method in a subclass can
is exactly the same as the name and parameter of a method in the parent class.
When this method is called by the instance object created by the subclass,
The definition method in the subclass will be called
, which is equivalent to overwriting the exact same method defined in the parent class,
This is also a representation of the polymorphism of object-oriented programming.
When a subclass overrides a method of a parent class, it can only throw fewer exceptions than the parent class.
or a child exception that throws an exception thrown by the parent class,
Because subclasses can solve some problems with the parent class,
Cannot have more problems than the parent class.
The subclass method can only be accessed more than the parent class, and cannot be smaller.
If the parent class method is a private type, then the
Subclasses do not have limitations on overrides,
The equivalent of a new method added to the subclass.
As to whether the overloaded method can change the type of the return value

If the parameter list of the two methods is exactly the same,
Whether they can have different return values to implement the overloaded overload.
This is not possible, we can use contradiction to illustrate this problem,
Because we can sometimes call a method without defining a return result variable,
That is, do not care about its return results,
For example, when we call the Map.Remove (key) method,
Although the Remove method has a return value,
But we don't usually define the variables that receive the returned results.
It is assumed that there are two names and parameter lists in the class that are completely
The same method, only the return type is different,
Java cannot determine which method the programmer is trying to invoke,
Because it cannot be judged by the return result type.


Override can be translated as overlay, literally can be known,
It is overriding a method and rewriting it,
In order to achieve different roles.
The most familiar overlay for us is the implementation of the interface method,
The method is generally declared in the interface,
When we implement it, we need to implement all the methods of the interface declaration.
In addition to this typical usage,
We may also override methods in the parent class in the inheritance.
Be aware of the following points in the overlay:
1. The marking of the method of coverage must be and the mark of the method being overridden
Exact match to reach the effect of coverage;
2. The return value of the overridden method must be the same as
The return of the overridden method is consistent;
3, the overridden method throws the exception must and
The exception that is thrown by the overridden method is the same, or its subclass;
4. The overridden method cannot be private,
Otherwise, only a new method is defined in its subclass,
It is not overwritten.

Overload may be more familiar to us,
Can be translated as overloaded,
It means that we can define some methods with the same name,
By defining different input parameters to differentiate these methods,
And then when called, the JVM will be based on different parameter styles,
To select the appropriate method to execute.
The following points are to be noted in using overloading:
1. You can only pass different parameter styles when using overloads.
For example, different parameter types, different number of parameters,
Different order of parameters
(Of course, several parameter types within the same method must be different,
For example, it can be fun (int,float), but not fun (int,int));
2. Cannot pass access permission, return type, exception thrown
for overloading;
3, the method of the exception type and number will not affect the overload;
4, for the inheritance,
If a method is in the parent class, the access permission is PRIAVTE,
Then it cannot be overloaded in subclasses,
If defined, it just defines a new method,
Without overloading the effect.


6. What are the three basic characteristics of a class? What are the advantages of each feature?

Classes have encapsulation, inheritance, and polymorphism.
Encapsulation: The encapsulation of a class provides a public, default,
Multi-level access rights, such as protection and private, to hide private
There are variables and implementation details for the methods in the class.
Inheritance: The inheritance of classes provides a mechanism for creating new classes from existing classes.
Inheritance (inheritance) makes a new class automatically owned
All inheritable members of the inherited class (the parent Class).
Polymorphism: The polymorphism of a class provides the diversity of method execution in a class
, there are two manifestations of polymorphism: overloading and overwriting.


7. What is the mechanism for polymorphism in Java?

A reference variable that is a parent class or interface definition can point to a subclass
Or an instance object that implements the class specifically,
And the method called by the program is dynamically bound at run time,
Is the method that refers to the specific instance object that the variable points to.
That is, the method of the object that is running in memory,
Instead of the method defined in the reference variable's type.

8. What is the difference between abstract class and interface?

Class that contains the abstract modifier is abstract,
An abstract class cannot create an instance object.
The class containing the abstract method must be defined as the abstract class,
Methods in the abstract class class do not have to be abstract. Abstract class definitions must be implemented in a specific (concrete) subclass, so there can be no abstract constructor or abstract static method. If the subclass does not implement all the abstract methods in the abstract parent class, then the subclass must also be defined as an abstract type.
An interface (interface) can be described as a special case of an abstract class, and all methods in an interface must be abstract. The method definition in the interface defaults to the public abstract type, and the member variable type in the interface defaults to public static final.
Here's a comparison of the syntax differences between the two:
1. Abstract classes can have construction methods, and interfaces cannot have constructors.
2. There can be ordinary member variables in the abstract class, there are no ordinary member variables in the interface
3. Abstract classes can contain non-abstract ordinary methods,
All methods in an interface must be abstract and cannot have a non-abstract normal method.
4. The type of access to an abstract method in an abstract class can be
Public,protected and (default type, though
Eclipse does not error, but it should not),
However, the abstract method in an interface can only be of the public type,
and the public abstract type is the default.
5. Abstract classes can contain static methods,
The interface cannot contain static methods
6. Both abstract classes and interfaces can contain static member variables.
The access type of a static member variable in an abstract class can be arbitrary,
But the variables defined in the interface can only be public static final types,
And the public static final type is the default.


9. The following statement creates a total of how many objects:
String s= "A" + "B" + "C" + "D";

Create an object that is analyzed as follows:
For the following code:
String S1 = "a";
String s2 = s1 + "B";
String s3 = "a" + "B";
SYSTEM.OUT.PRINTLN (s2 = = "AB");
System.out.println (s3 = = "AB");
The first statement prints a result of false,
The second statement prints a result of true,
This means that Javac compilation can be used on string constants
The directly added expression is optimized,
There is no need to wait until the run time to do addition processing,
Instead, the plus sign is removed at compile time,
Compiles it directly into a result that these constants are connected to.
The first line of code in the topic is optimized by the compiler at compile time.
The equivalent of a string that defines a "ABCD" directly,
Therefore, the above code should only create a string object.
Write the following two lines of code,
String s = "a" + "B" + "C" + "D";
System.out.println (s = = "ABCD");
The result of the final printing should be true.

10, the difference between ArrayList and vector,
The difference between HashMap and Hashtable

ArrayList and vectors are mainly from two aspects.
I. Synchronicity: vectors are thread-safe,
In other words, it's synchronous,
And ArrayList is not a safe line program,
It's not synchronous.
Two. Data growth: When growth is needed, vectors grow by default to the original
, and ArrayList is half the original.
HashMap and Hashtable are mainly from three aspects.
I. Historical reasons: Hashtable is based on the old dictionary class,
HashMap is an implementation of the map interface introduced by Java 1.2
Two. Synchronization: Hashtable is thread-safe,
In other words, it's synchronous,
And HashMap is not a safe line program, not synchronous
Three. Value: Only HashMap allows you to use null values as
Key or value of an entry for a table

11, talk about final, finally, finalize the difference

Final modifier (keyword) If a class is declared final, it means that it can no longer derive a new subclass and cannot be inherited as a parent class.
Therefore a class cannot be declared as abstract,
is declared final. Declares a variable or method to be final,
They are guaranteed to be used without being
Change.
A variable declared final must be given an initial value at the time of declaration.
It can only be read in subsequent references and cannot be modified.
The method that is declared final is also
Same can only be used, cannot be overloaded
Finally, the finally block is provided when the exception is processed again.
To perform any cleanup operations. If an exception is thrown,
Then the matching catch clause executes, and
The rear control will enter the finally block (if any)
Finalize? Method name.
Java technology allows the use of the Finalize () method to
The garbage collector clears objects from memory
Before doing the necessary cleanup work. This
method is determined by the garbage collector in determining this object
Called on this object when it is not referenced.
It is defined in the Object class, so all classes are
Inherited it.
Subclasses override the Finalize () method to organize system resources or
Perform other cleanup work.
The Finalize () method is to delete the object in the garbage collector
That was previously called on this object.

12, String, StringBuffer StringBuilder difference.

String is an immutable string, and the object cannot be changed;
The StringBuffer is a mutable string,
If you are working on the contents of a string frequently,
Especially if the content is to be modified, then use StringBuffer,
If the last string is required,
Then use the ToString () method of StringBuffer, thread safety;
StringBuilder is starting with JDK 5,
For stringbuffer This class complements the equivalence class used by a single thread;
The StringBuilder class should usually be used first,
Because it supports all the same operations,
But because it does not perform synchronization, it is faster.

13, the difference between Collection and collections?

Collection is the interface under Java.util,
It is the parent interface of various collections,
The interfaces that inherit from it are mainly set and list;
Collections is a class under the Java.util,
is a collection-specific Help class that provides a series of static methods for implementing a variety of
Collection of operations such as search, sort, thread-safe.

14, please say Arraylist,vector, LinkedList storage performance and features

Both ArrayList and vectors store data using arrays,
The number of elements in this array is greater than the actual stored data in order to increase
and insert elements, both of which allow the element to be indexed directly by ordinal,
But inserting elements involves memory operations such as array element movement,
So indexing data is fast and inserting data is slow,
Vector because of the use of the Synchronized method (thread safety),
The performance of the ArrayList is usually worse than
Instead, LinkedList uses a doubly linked list for storage,
Index data by ordinal requires forward or back traversal, but
When inserting data, you only need to record the item's front and rear items.
So the insertion speed is faster.

15, the difference between HashMap and Hashtable?

HashMap is a lightweight implementation of Hashtable
(Non-thread-safe implementations), they all implement the map interface,
Main differences
Is that HASHMAP allows null (NULL) key values (key),
Because of non-thread safety, the efficiency is higher than Hashtable.
HashMap allow
Null is used as a entry key or value, and Hashtable is not allowed.
HashMap put Hashtable's contains
The method was removed and changed into Containsvalue and ContainsKey.
Because the contains method is easy to cause misunderstanding. Hashtable
Inherit from the Dictionary class,
And HashMap is an implementation of the map interface introduced by Java1.2.
The biggest difference is that
The method of Hashtable is synchronize,
While HashMap is not, when multiple threads are accessing Hashtable,
Don't need to be yourself
Its approach is synchronous, and HashMap must provide synchronization.

16, the Java language how to do exception handling,
Keyword: What does throws,throw,try,catch,finally mean?
Can I throw an exception in a try block?

Java uses an object-oriented approach to exception handling,
Classify different kinds of anomalies and provide good interfaces.
In Java, each exception is an object,
It is an instance of the Throwable class or other subclass.
Throws an exception object when a method has an exception,
The object contains exception information,
The method that invokes the object can catch the exception and handle it.
Java exception handling is achieved by 5 key words:
Try, catch, throw, throws, and finally.
In general, a try is used to execute a program,
If an exception occurs, the system throws (throws) an exception,
At this point you can catch (catch) it by its type,
or finally (finally) is handled by the default processor.
Use try to specify a piece of program that prevents all "exceptions".
Immediately following the try program,
You should include a catch clause to specify the type of "exception" you want to catch.

The throw statement is used to explicitly throw an "exception".
Throws is used to indicate the various "exceptions" that a member function might throw.
Finally, a piece of code is executed to ensure that a piece of code occurs regardless of the "exception".
You can write a try statement outside of a member function call,
Write another try statement inside this member function to protect the other code.
Whenever a try statement is encountered, the "exception" frame is placed on the stack,
Until all the try statements are complete.
If the next-level try statement does not handle an "exception",
The stack expands until it encounters a try statement that handles this "exception."

17. What is Java serialization and how do I implement Java serialization?
Or, explain the role of the serializable interface.

We sometimes pass a Java object into a stream of bytes.
Or recover from a byte stream into a Java object,
For example, to store Java objects on a hard disk or to send to a network
Other computers, this process we can write our own code to put a
The Java object becomes a stream of bytes in a format,
However, the JRE itself provides this support,
We can call OutputStream's WriteObject method to do that,
If we're going to let Java do it for us,
The object to be transmitted must implement the Serializable interface,
In this way, Javac is compiled with special handling,
The compiled class can be manipulated by the WriteObject method,
This is known as serialization.
Classes that need to be serialized must implement the Serializable interface.
The interface is a mini interface, where there is no need to implement the method,
Implements serializable just to mark that the object is serializable.


For example, in web development, if an object is stored in a session,
Tomcat will serialize the session object to the hard disk when rebooting,
This object must implement the Serializable interface.
If the object is to be transmitted over a distributed system or via RMI, etc.
Remote invocation, which requires the transfer of objects over the network,
The object being transmitted must implement the Serializable interface.


18, the advantages and principles of garbage collection. and consider 2 kinds of recycling mechanisms.

One notable feature of the Java language is the introduction of a garbage collection mechanism,
Solve the most headache of C + + Programmer's memory management problem,
It makes it unnecessary for Java programmers to consider memory management when writing programs.
Because there is a garbage collection mechanism, objects in Java no longer have a "scope" concept,
Only references to objects have scope.
Garbage collection can effectively prevent memory leaks,
Efficient use of memory that can be used.
The garbage collector is usually run as a separate low-level thread,
An unpredictable situation in which a dead or long period of time is stored in the heap.
No objects are used for clarity and recycling,
The programmer cannot invoke the garbage collector in real time on an object or all
Object for garbage collection. The recycling mechanism has a generational replication of garbage collection and
Flag garbage collection, incremental garbage collection.

19. Is there a memory leak in Java? Please describe it briefly.

Memory leaks are memory that cannot be reclaimed in the system.
Sometimes it can cause memory shortages or system crashes. Java has memory
Leaked. Memory leaks in Java, of course, are: there is no useless but
The garbage collector cannot reclaim objects. And even if there's a memory leak,
Problems exist and do not necessarily show up. Implement the Stack Yourself
A memory leak may occur when data structures are present.

20. Please try to describe the GC in the Java language (Gabage Collection)

GC is a garbage collector. Java programmers don't have to worry about memory management,
Because the garbage collector is automatically managed. To request garbage collection,
You can call one of the following methods:
System.GC (); Runtime.getruntime (). GC (),
The Java language does not provide a display action method that frees allocated memory.

21, JDK1.5 introduced a number of new language features,
More conducive to writing code, such as support for generics,
Automatic split/boxing, enhanced for loop, etc., please combine code to show examples.

Generic type:
list<string> list = new arraylist<string> ();
String s = list.get (0);
Automatic Disassembly/Packing:
Automatic conversion between the base type and the base type object.
Int a = new Integer (5);
Integer B = A;
Enhanced for Loop:
...
for (String s:list) {
...
}
...

22, Anonymous Inner class (anonymous internal classes)
Whether you can extends (inherit) other classes, whether you can implement
(Implementation) interface (interface)?

Anonymous inner classes can inherit other classes, as well as implement interfaces, with the use of:
JButton button = new JButton ();
Button.addactionlistener (New ActionListener ()
{
public void actionperformed (ActionEvent e) {//some mothod ...}
});
This usage is often used in swing programming because it requires a registration listener mechanism, and the listener class is only
Service to a component, it is most convenient to set the class to an inner class/anonymous class

23.8 Basic types of Java
Integer type: byte short int long
Float type: float double
Character type: Char
Boolean Type: Boolean

24. Can I include more than one class (not an inner class) in a ". Java" source file? What are the restrictions?
There can be multiple classes, but only one public class, and the class name of public must match the file name.


25, short S1 = 1; S1 = s1 + 1; what's wrong? Short S1 = 1; S1 + = 1; what's wrong?
for short S1 = 1; S1 = s1 + 1; Because the type of the expression is automatically promoted by the s1+1 operation, the result is type int,
When you assign a value to the short type S1, the compiler reports an error that requires a cast type.
for short S1 = 1; S1 + = 1; since + = is a Java-language-defined operator, the Java compiler will treat it specially, so it compiles correctly.

26. Can I store a Chinese character in char type?
Char variables are used to store Unicode-encoded characters, and Unicode-encoded character sets contain Chinese characters, so, of course, char-type variables
can store Chinese characters. However, if a particular Chinese character is not included in the Unicode encoding character set, then the Char type variable
You cannot store this special character. Supplemental Note: Unicode encoding consumes two bytes, so variables of type char are also two bytes.


27. Can the constructor constructor be override?
The constructor constructor cannot be inherited and therefore cannot override override, but can be overloaded with overload.

28, interface can inherit interface? is an abstract class achievable (implements) interface? Can abstract classes inherit concrete classes (concrete Class)?
Can I have a static main method in an abstract class?
Interfaces can inherit interfaces. Abstract classes can implement (implements) interfaces, and whether abstract classes can inherit concrete classes. There can be static main methods in an abstract class.


Java object-oriented face question

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.