hello i am doing my assignment on simple calculator in java.Now I want to handle exceptions in it. so i need some information about exception for exemple a user enter any expression like (10+23+56-55)
it is corrent formate but when the user enter wrong formate like (20++56//5)
i mean operator in wrong formate so it is also an exception now i want to handle it. i need a built in class that handle this type of exception.
moaz.amin.37
-12
Junior Poster
Recommended Answers
Jump to Postso, you've told us what you need to do. now, what exactly is your question about it?
get an array of chars from the String, then check each element, and verify that the next element of the char is valid. if not, throw an Exception.
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.