The link was fantastic advice. I found my answer. Many thanks
Type: Posts; User: TheCoder
The link was fantastic advice. I found my answer. Many thanks
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...
:ar!
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Martina3.CreditCardTest1.main(CreditCardTest1.java:7)
Java Result: 1
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.
Can you give me any tips or tricks of how to recognise exceptions when reading code?! That would be really helpful.:rolleyes:
public class CreditCardTest1
{
public static void main(String args[])
{
String creditCard = args[0].toUpperCase();
if(creditCard.equals(AllowedCreditCard.VISA.name()))
...
Class "NumberFormatter" does not have a 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;
...
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.