Define a class based on the UML class diagram according to your NSU ID. Choose NewDate if your middle four digits of your NSU ID is odd, otherwise choose NewTime. The first constructor initialized with today's date or current time. The second constructor initialized the object with the given string. The separator of the elements may be r,“ or:. Use split method of String class. The third constructor extract Date or Time elements from the given Calendar object. Codes for extracting information from Calendar object is given below. The other methods are self- explanatory. Newbate day, month, year. int interfaces Comparable NewDate •compareToNewoate o)kint -NewDateo -NewDate(stString) -NewDate(dtCalendar) -setDate(d,m.yintboolean getDateg NewDate -difference(d NewDate) int -compareTo(dNewDate) int -clone0:Object tostring0:String -D interface Cloneable NowTime Fhour, minute, second int interface Comparable NewTime compareTo(NewTime olint -NewTimeo -NewTime(s String) -NewTimetCalendar) -seftime(ss.mm.hhint boolean gefTimeo NewTime -difference(tNswTima)cint -comparaTotNewTimejint cloneo Object -to Sringo Sting -Dinterface Cloneable Create 3 objects with reference variables x, y and z using three constructors. Show the usage of set, get, difference, compareTo, clone and toString methods using these objects in the main method defined in the same class. calendar gc = new Gregoriancalendar (); day = gc.get (Calendar. DAY_OF_MONTH);
Define a class based on the UML class diagram according to your NSU ID. Choose NewDate if your middle four digits of your NSU ID is odd, otherwise choose NewTime. The first constructor initialized with today's date or current time. The second constructor initialized the object with the given string. The separator of the elements may be r,“ or:. Use split method of String class. The third constructor extract Date or Time elements from the given Calendar object. Codes for extracting information from Calendar object is given below. The other methods are self- explanatory. Newbate day, month, year. int interfaces Comparable NewDate •compareToNewoate o)kint -NewDateo -NewDate(stString) -NewDate(dtCalendar) -setDate(d,m.yintboolean getDateg NewDate -difference(d NewDate) int -compareTo(dNewDate) int -clone0:Object tostring0:String -D interface Cloneable NowTime Fhour, minute, second int interface Comparable NewTime compareTo(NewTime olint -NewTimeo -NewTime(s String) -NewTimetCalendar) -seftime(ss.mm.hhint boolean gefTimeo NewTime -difference(tNswTima)cint -comparaTotNewTimejint cloneo Object -to Sringo Sting -Dinterface Cloneable Create 3 objects with reference variables x, y and z using three constructors. Show the usage of set, get, difference, compareTo, clone and toString methods using these objects in the main method defined in the same class. calendar gc = new Gregoriancalendar (); day = gc.get (Calendar. DAY_OF_MONTH);
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Please use NewDate Class.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY