• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How Many types Of Errors in java ?

 
Ranch Hand
Posts: 216
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some One asked me that , How many types of Errors are there in java ?
I replied, Only one.
am I wrong ?
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends what you mean by the question. There are several Error classes for example, including: StackOverflowError, AssertionError, OutOfMemoryError. Is that the sort of error you're talking about?
 
Nikhil Sagar
Ranch Hand
Posts: 216
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Matthew Brown wrote:It depends what you mean by the question. There are several Error classes for example, including: StackOverflowError, AssertionError, OutOfMemoryError. Is that the sort of error you're talking about?


I already posted the Full Question. I know the question is incomplete but just tell me a appropriate answer based on the information available.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with Matt - the question is vague at best.

edit - I would say the correct answer would be "Could you elaborate on what you mean by 'errors in java'".
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Based on the information available, we can't say if you were right or wrong. I think I could come up with interpretations where the answer would be 1, 2, 3, lots or "unlimited".

Depending on context, I'd either ask for clarification or say "assuming that you mean ..., then the answer is ...". When you said the answer was "one", what did you think the question meant?
 
Nikhil Sagar
Ranch Hand
Posts: 216
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

fred rosenberger wrote:I agree with Matt - the question is vague at best.

edit - I would say the correct answer would be "Could you elaborate on what you mean by 'errors in java'".



""Could you elaborate on what you mean by 'errors in java'""
Wow fred this was exactly what i said to her.
And she replied with a smile that what about compile time errors ?
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nikhil Sagar wrote:

Matthew Brown wrote:It depends what you mean by the question. There are several Error classes for example, including: StackOverflowError, AssertionError, OutOfMemoryError. Is that the sort of error you're talking about?


I already posted the Full Question. I know the question is incomplete but just tell me a appropriate answer based on the information available.



The appropriate answer is some version of, "Please clarify the question."
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nikhil Sagar wrote:

fred rosenberger wrote:I agree with Matt - the question is vague at best.

edit - I would say the correct answer would be "Could you elaborate on what you mean by 'errors in java'".



""Could you elaborate on what you mean by 'errors in java'""
Wow fred this was exactly what i said to her.
And she replied with a smile that what about compile time errors ?



Sounds like she's not a very good interviewer and is more interested in showing how clever she is than in actually engaging in a discussion with you to get a feel for your level of understanding of Java.
 
Nikhil Sagar
Ranch Hand
Posts: 216
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Verdegan wrote:

Nikhil Sagar wrote:

fred rosenberger wrote:I agree with Matt - the question is vague at best.

edit - I would say the correct answer would be "Could you elaborate on what you mean by 'errors in java'".



""Could you elaborate on what you mean by 'errors in java'""
Wow fred this was exactly what i said to her.
And she replied with a smile that what about compile time errors ?



Sounds like she's not a very good interviewer and is more interested in showing how clever she is than in actually engaging in a discussion with you to get a feel for your level of understanding of Java.


Agree Jeff, but in future if someone tell me that compile time errors are also errors in java, because many books use the line compile time errors.
But i realize that "compile time errors" is a wrong statement because in SCJP6 by K&B, authors never use "compile time error" they always use "compiler complains".
Is that correct ??
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nikhil Sagar wrote:[
Agree Jeff, but in future if someone tell me that compile time errors are also errors in java, because many books use the line compile time errors.



Well, yes, compile-time errors are a "type of error in Java." This is true. But when someone simply asks a vague, meaningless question like "How many types of errors are there in Java?" it's impossible to know what he means and what he's looking for without some clarification.

But i realize that "compile time errors" is a wrong statement because in SCJP6 by K&B, authors never use "compile time error" they always use "compiler complains".



No, it's not wrong. And K&B is not the ultimate authority on Java terminology. The JLS is. People use the phrase "compile-time errors" all the time, and although it may not be part of the official terminology from the JLS, it's in common use and everybody knows what it means. The term is not wrong in and of itself, and it's not wrong to say that compile-time errors are a type of error you can get in Java.

Now, having said that, there are contexts where it would be wrong, if the question was clearer. For example, if the question had been, "How many types of exception are there in Java", then "compile-time exception" is not correct. There is no such thing, especially in the sense that most people use it, where they seem to think that unchecked exceptions are "compile-time" exceptions. I understand where that thinking comes from, and there's a certain logic behind it, but it goes against the standard terminology, and it leads to confusion.
 
Nikhil Sagar
Ranch Hand
Posts: 216
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Verdegan wrote:

Nikhil Sagar wrote:[
Agree Jeff, but in future if someone tell me that compile time errors are also errors in java, because many books use the line compile time errors.



Well, yes, compile-time errors are a "type of error in Java." This is true. But when someone simply asks a vague, meaningless question like "How many types of errors are there in Java?" it's impossible to know what he means and what he's looking for without some clarification.

But i realize that "compile time errors" is a wrong statement because in SCJP6 by K&B, authors never use "compile time error" they always use "compiler complains".



No, it's not wrong. And K&B is not the ultimate authority on Java terminology. The JLS is. People use the phrase "compile-time errors" all the time, and although it may not be part of the official terminology from the JLS, it's in common use and everybody knows what it means. The term is not wrong in and of itself, and it's not wrong to say that compile-time errors are a type of error you can get in Java.

Now, having said that, there are contexts where it would be wrong, if the question was clearer. For example, if the question had been, "How many types of exception are there in Java", then "compile-time exception" is not correct. There is no such thing, especially in the sense that most people use it, where they seem to think that unchecked exceptions are "compile-time" exceptions. I understand where that thinking comes from, and there's a certain logic behind it, but it goes against the standard terminology, and it leads to confusion.



Thanks jeff, and i am not 100% sure that i never saw a statement like compile time error in SCJP6 by K&B. So, the fault is all mine.
if someone in future ask me again this same question then i will answer him, "insufficient data, next question please. "
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally I think that niggling over whether the errors reported by the compiler are "errors in Java" is a waste of time, even if that was where the conversation went after what you've told us so far. As the interviewer, I could ask you whether failing to document your code was an error, for example, and I wouldn't expect to be discussing whether various books described it as an "error" in so many words or not.
reply
    Bookmark Topic Watch Topic
  • New Topic