# 针对 Oracle 企业管理器项目的实际 Java 面试问题

> 原文： [https://howtodoinjava.com/interview-questions/real-java-interview-questions-asked-for-oracle-enterprise-manager-project/](https://howtodoinjava.com/interview-questions/real-java-interview-questions-asked-for-oracle-enterprise-manager-project/)

[Oracle 企业管理器](https://www.oracle.com/technetwork/oem/enterprise-manager/overview/index.html "oracle enterprise manager")可帮助私有和公共云服务提供商在释放管理资源的同时，将云服务的速度提高十倍。 这是来自 Oracle 的非常受欢迎的产品。

**Sreenath Ravva**, one of reader on *HowToDoInJava*, has appeared on a interview for position in above product i.e. oracle enterprise manager. Below listed questions were shared with me by him so that I can share with all of you, in hope that it will benefit few of us on any fine day.

注意：我已尝试在网页上放置链接，以供您参考以下面试问题的答案。 它们可能不足以涵盖该主题，但是它们可以帮助您入门。

## 第一轮（电话）java 面试题

**1）您可以开始讲述自己和您的项目吗？**

<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="375" src="https://www.youtube.com/embed/CumOvDWnUDY?feature=oembed" title="Tell Me About Yourself - Best Answer to this Interview Question - YouTube Top Pick" width="500"></iframe>

**2）什么是 Java 中的抽象和封装？**

– [//howtodoinjava.com/object-oriented/understanding-abstraction-in-java/](//howtodoinjava.com/object-oriented/understanding-abstraction-in-java/)
– [//howtodoinjava.com/object-oriented/encapsulation-in-java-and- 与抽象的关系/](//howtodoinjava.com/object-oriented/encapsulation-in-java-and-its-relation-with-abstraction/)

**3）方法重载规则？ 我们可以在子类中重载超类方法吗？ 该示例进行了讨论。**

1.  [//howtodoinjava.com/2013/07/15/what-is-polymorphism-in-java](//howtodoinjava.com/object-oriented/what-is-polymorphism-in-java/)
2.  [http://stackoverflow.com/questions/10901259/java-overloading-rules](https://stackoverflow.com/questions/10901259/java-overloading-rules)

**4）方法覆盖规则？**
 [http://docs.oracle.com/javase/tutorial/java/IandI/override.html]( http://docs.oracle.com/javase/tutorial/java/IandI/override.html)

**5）Java 中的扩大和缩小？ 讨论发生在例子上吗？**

[http://stackoverflow.com/questions/16781649/real-world-application-of-widening-narrowing-conversion](https://stackoverflow.com/questions/16781649/real-world-application-of-widening-narrowing-conversion)

**6）我只能在代码中尝试块吗？**

不。您至少需要 catch 块或 finally 块以及 try 块。 [直到 Java 6]

As “Ievgen” mentioned in comments, JDK 7 onwards you can use [try-with-resources](//howtodoinjava.com/java-7/automatic-resource-management-with-try-with-resources-in-java-7/ "try-with-resource") with “optional” catch or finally block.

```java
try (FileInputStream f = new FileInputStream("ttt")) 
		{
			System.out.println("t");
		}
```

**7）线程：生产者和消费者有问题吗？**

*   [http://en.wikipedia.org/wiki/Producer-consumer_problem](https://en.wikipedia.org/wiki/Producer-consumer_problem)
*   [//howtodoinjava.com/java-5/how-to-use-blockingqueue-and-threadpoolexecutor-in-java/](//howtodoinjava.com/java-5/how-to-use-blockingqueue-and-threadpoolexecutor-in-java/)

**8）为什么在 Object 类中定义了 wait()，notify()和 notifyAll()？**

*   [//howtodoinjava.com/2013/03/04/core-java-interview-questions-series-part-2/](//howtodoinjava.com/java/interviews-questions/core-java-interview-questions-series-part-2/)
*   [http://stackoverflow.com/questions/17840397/concept-behind-putting-wait-notify-methods-in-object-class](https://stackoverflow.com/questions/17840397/concept-behind-putting-wait-notify-methods-in-object-class) 

**9）我们可以重写 wait()或 notify()方法吗？**

在 Object.java 中，方法 getClass()，notify()，notifyAll()和三个 wait()方法是最终的，因此您无法覆盖它们。

**10）wait()，sleep()和 yield()之间的区别？**

[http://stackoverflow.com/questions/9700871/what-is-difference-between-sleep-method-and-yield-method-of-multi-threading](https://stackoverflow.com/questions/9700871/what-is-difference-between-sleep-method-and-yield-method-of-multi-threading)

**11）解释线程类**中的 join()方法

[http://stackoverflow.com/questions/18479771/java-multithreading-concept-and-join-method](https://stackoverflow.com/questions/18479771/java-multithreading-concept-and-join-method)

## 第二轮（面对面）java 面试题

**1) Can you just start telling about your self and your project?**

*请参阅上面列表中的第一个问题。*

**2）您是否遇到内存不足错误？ 如果是，您如何解决？ 告诉不同的情况为什么会这样？**

[http://stackoverflow.com/questions/37335/how-to-deal-with-java-lang-outofmemoryerror-java-heap-space-error-64mb-heap](https://stackoverflow.com/questions/37335/how-to-deal-with-java-lang-outofmemoryerror-java-heap-space-error-64mb-heap)

**3）数据库连接泄漏？**

[http://blogs.msdn.com/b/snehadeep/archive/2009/04/28/connection-leak-its-symptoms-and-troubleshooting.aspx](https://blogs.msdn.com/b/snehadeep/archive/2009/04/28/connection-leak-its-symptoms-and-troubleshooting.aspx)

**4）编写一个程序，使用第三个变量将两个数字互换掉？**

```java
import java.io.*;
public class SwappingNumberWithoutThirdVariable
{
    public static void main(String[] args)throws IOException
    {
        int a = 0 ,b = 1;

        System.out.println("a = "+a);
        System.out.println("b = "+b);

        //Beginning of Swapping
        a = a + b;
        b = a - b;
        a = a - b;
        //End of Swapping

        System.out.println("The numbers after swapping are");
        System.out.println("a = "+a);
        System.out.println("b = "+b);
    }
}

```

**5）编写程序以对数组进行排序并删除重复项？**

[http://stackoverflow.com/questions/17967114/how-to-remove-dumoments-from-an-array-in-java](https://stackoverflow.com/questions/17967114/how-to-remove-duplicates-from-an-array-in-java)
 **6）在 单例人士？**

[//howtodoinjava.com/design-patterns/singleton-design-pattern-in-java/](//howtodoinjava.com/design-patterns/singleton-design-pattern-in-java/)

**7）我有两个包含整数的数组。 编写一个程序来合并这两个数组并删除重复的元素？ 最后，我需要一个应该具有唯一元素的数组？**

[http://stackoverflow.com/questions/5057156/merging-lists-into-a-single-array-with-unique-elements](https://stackoverflow.com/questions/5057156/merging-lists-into-a-single-array-with-unique-elements)

**8）编写程序以使用 JDBC 和结果集从表中获取数据？**

[//howtodoinjava.com/2013/11/24/jdbc-select-query-example/](//howtodoinjava.com/misc/jdbc-select-query-example/)

**9）如何从 HashMap 获取数据？**

[//howtodoinjava.com/java/interviews-questions/how-hashmap-works-in-java/](//howtodoinjava.com/java/collections/how-hashmap-works-in-java/)

**10）Vector 和 ArrayList 之间的区别？**

//howtodoinjava.com/java/collections/useful-java-collection-interview-questions/
 **11）睡眠和等待之间的区别？**

[//howtodoinjava.com/2013/03/08/difference-between-sleep-and-wait/](//howtodoinjava.com/java/multi-threading/difference-between-sleep-and-wait/)

**12）还问了一些 sql 查询。**

练习一下。

**13）编写程序来打印斐波那契数列？**

```java
public class FibonacciSampleCode
{
    public static void main(String[] args) 
    {
        FibonacciSampleCode fs = new FibonacciSampleCode();
        fs.fibonacci(); 
    }
    public void fibonacci() 
    {
        int numb1 = 1;
        int numb2 = 1;
        int temp = 0;

        Scanner input=new Scanner(System.in);
        System.out.println("How Many Terms? (Up To 45)");
        int x=input.nextInt();
        x=x-2;

        System.out.println(numb1);
        System.out.println(numb2);

        for (int i = 0; i < x; i++) 
        {
            System.out.println(numb1 + numb2 + " ");
            temp = numb1;
            numb1 = numb2;
            numb2 = temp + numb2;
        }
    }
}

```

**14）我们可以像下面的代码一样编写 try catch 块吗？**

```java
try
{
	try
	{
	}
}
catch()
{
}

```

[//howtodoinjava.com/2012/12/why-try-catch-finally-blocks-require-braces/](//howtodoinjava.com/for-fun-only/why-try-catch-finally-blocks-require-braces/)

**15）finally 块有什么用？**

[http://stackoverflow.com/questions/15768645/what-is-the-benefit-to-use-finally-after-try-catch-block-in-java](https://stackoverflow.com/questions/15768645/what-is-the-benefit-to-use-finally-after-try-catch-block-in-java)

**16）final 关键字有什么用？**

[http://en.wikipedia.org/wiki/Final_%28Java%29](https://en.wikipedia.org/wiki/Final_%28Java%29)

**17）我可以将类声明为静态吗？**

[http://stackoverflow.com/questions/2376938/why-cant-a-java-class-be-de-clared-as-static](https://stackoverflow.com/questions/2376938/why-cant-a-java-class-be-declared-as-static)

**18）什么是静态方法和静态变量？**

[http://stackoverflow.com/questions/7815664/static-method-and-static-variable-java](https://stackoverflow.com/questions/7815664/static-method-and-static-variable-java)

**19）我可以将一个类声明为私有类吗？**

[http://docs.oracle.com/javase/tutorial/java/javaOO/classdecl.html](https://docs.oracle.com/javase/tutorial/java/javaOO/classdecl.html)
 **20）如果我在 try 块中写 return 会发生什么？ 最终会执行吗？ 如果写入 system.exit()，最终将执行块会怎样？**

[http://stackoverflow.com/questions/65035/does-finally-always-execute-in-java](https://stackoverflow.com/questions/65035/does-finally-always-execute-in-java)

**21）为什么要更改公司？**

[http://www.linkedin.com/groups/How-do-you-answer-Why-1792709.S.54631120](https://www.linkedin.com/groups/How-do-you-answer-Why-1792709.S.54631120 )

Nobody expect you tell the truth.. 🙂

这是他在写给我有关此问题的邮件时回想的所有**面试问题**。 我们希望这会对计划下一次与 oracle 进行面试的我们某些人有所帮助。

**祝您学习愉快！**