java-interview | Java interview-高级Java面试题2019 | Learning library
kandi X-RAY | java-interview Summary
kandi X-RAY | java-interview Summary
Java interview-高级Java面试题2019
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Entry point
- Test 2
- Compares this Person with the specified Person
- Compares the Person with the specified name
- Set the name of the entry
- Gets the name
- Work for a thread
- Print the criter
- Print out exit
- Main entry point
java-interview Key Features
java-interview Examples and Code Snippets
public static void main(String[] args) {
// Calendar is abstract
// Calendar calendar = new Calendar(); //COMPILER ERROR
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.DATE, 24);
calendar.set(Calendar.MONTH, 8);// 8 - S
public static void main(String[] args) {
Map map = new HashMap();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
Iterator iterator = map.keySet().iterator();
while (iterator.hasNext()) {
System.out.p
@Override
public void run() {
try {
operation.method1();
operation.method2();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Community Discussions
Trending Discussions on java-interview
QUESTION
I find difine aggregation as "We call aggregation those relationships whose objects have an independent lifecycle, but there are ownership, and child object can not belong to another parent object."
And i interested about "child object can not belong to another parent object", is that true ?
Link on defenition: https://github.com/learning-zone/java-interview-questions#:~:text=What%20is%20the%20difference%20between%20aggregation%20and%20composition%3F
...ANSWER
Answered 2022-Apr-02 at 14:06Not really. Aggregation is defined as a relationship between two objects where an object A "uses" an object B. A and B can exist independently. Furthermore, if A uses B, B can still be used by other objects. The aggregation relationship does not constitute an exclusive binding between the used object and its user. Aggregation is usually presented in all those scenarios where an object provides a service and any other object can ask for it.
On the other hand, composition is defined as the relationship where an object A owns an Object B. In fact, B cannot exist without being "owned" by A; therefore it cannot live on its own (or it does not make sense to exist on its own). Composition describes all those situations where an object appears as another object's attribute.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install java-interview
You can use java-interview like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the java-interview component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page