Sorry, I'm not trying to intimidate you, but I do want you to think.
Ok, so first you have your if statement which checks to see if the time is valid:
if(this.validate())
{
// we have a...
Type: Posts; User: helloworld922
Sorry, I'm not trying to intimidate you, but I do want you to think.
Ok, so first you have your if statement which checks to see if the time is valid:
if(this.validate())
{
// we have a...
What part are you having trouble with?
You can perform multiple statements in one if statement by using brackets.
if(condition== true)
{ // execute all statements in here if condition is true,...
Yes, that's correct. That is indeed the recommended convention.
You can display in a 12 hour format by creating a temporary hour variable, and a temporary string variable to hold "am" or "pm". This variable would hold the value of hh if hh is less than or equal...
Looked up the java language standard, and it turns out that any unicode character which isn't a number or pre-defined java symbol is considered a "JavaLetter", and thus can be used in the name. This...
Yep. The name can start with any letter (upper or lower case), an underscore, or some currency symbols (such as the british pound symbol or dollar symbol). Actually, any valid name for a...
if(hh>12)
hh=hh-12;
Time ob = new Time(20,55,30);
if (ob.validate())
You're automatically subtracting 12 from hh no matter if the format is valid or not....
Not true. The only requirement is that once you name a class, you must stick to that name. It is generally recommended that you start classes with a capital letter, though. The fixed validate logic...