Search:

Type: Posts; User: TheCoder

Search: Search took 0.60 seconds.

  1. Re: Why is answer A correct and not answer B?? I always thought a class has to implement an interface!! Is it different with generics?

    The link was fantastic advice. I found my answer. Many thanks
  2. Why is answer A correct and not answer B?? I always thought a class has to implement an interface!! Is it different with generics?

    QUESTION: 163
    A programmer must create a generic class MinMax and the type parameter of MinMax
    must implement Comparable. Which implementation of MinMax will compile?
    A. class MinMax<E extends...
  3. Re: Why is this code giving me an ArrayIndexOutOfBoundException?

    :ar!
    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
    at Martina3.CreditCardTest1.main(CreditCardTest1.java:7)
    Java Result: 1
  4. Replies
    2
    Views
    368

    Re: Recognise exceptions when reading code

    Thanks, I will do that. With some codes I find it difficult to see that there is going to be an exception thrown. For example the code I have posted earlier, I would not have seen the exception.
  5. Replies
    2
    Views
    368

    Recognise exceptions when reading code

    Can you give me any tips or tricks of how to recognise exceptions when reading code?! That would be really helpful.:rolleyes:
  6. Why is this code giving me an ArrayIndexOutOfBoundException?

    public class CreditCardTest1
    {
    public static void main(String args[])
    {
    String creditCard = args[0].toUpperCase();
    if(creditCard.equals(AllowedCreditCard.VISA.name()))
    ...
  7. Re: Why can I not execute the following code? When I try to run it, I get a message that there is no main method.

    I will double check, thanks
  8. Re: Why can I not execute the following code? When I try to run it, I get a message that there is no main method.

    Class "NumberFormatter" does not have a main method.
  9. Why can I not execute the following code? When I try to run it, I get a message that there is no main method.

    import java.util.*;
    import java.text.*;

    public class NumberFormatter
    {
    public static void main(String args[])
    {
    double amount = 1276789.34;
    double percent = 0.95;
    ...
  10. Replies
    2
    Views
    211

    Hello Java Experts

    I am fairly new to the programming world and I will probably have tons of questions very soon. I am very excited. Please be patient with me.
    Talk to you very soon.
Results 1 to 10 of 10