Public Questions for tag [java]

Ask Question

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.

6 questions


0

Vote

4

Answers

28

View

I am using the Scanner methods nextInt() and nextLine() for reading input.It looks like this:System.out.println("Enter numerical value"); int option; option = input.nextInt(); // Read numerical

Jan 10

0

Vote

4

Answers

76

View

What does ArrayIndexOutOfBoundsException mean and how do I get rid of it?Here is a code sample that triggers the exception:String[] names = { "tom", "bob", "harry" }; for (int i = 0; i <= names.le

Jan 10

0

Vote

4

Answers

23

View

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.Is == bad? When should it an

Jan 10

0

Vote

4

Answers

26

View

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?What methods/tools can be used to determine the cause so that you stop the exception from causing the program to

Jan 10

0

Vote

4

Answers

48

View

Here is a piece of C++ code that shows some very peculiar behavior. For some strange reason, sorting the data (before the timed region) miraculously makes the loop almost six times faster.#include <

Jan 10

0

Vote

3

Answers

98

View

I am learning Exception handling in java. I just want to know, does the finally() block always get executed in Java Exception Handling?this code in java, can I be absolutely sure that the finally bloc

Dec 27