Concept explainers
(Use the GregorianCa1endar class) Java API has the GregorianCalendar class in the java.util package, which you can use to obtain the year, month, and day of a date. The no-arg constructor constructs an instance for the current date, and the methods get (GregorianCalendar.YEAR), get (GregorianCalendar.MONTH), and get (GregorianCalendar.DAY_OF_MONTH) return the year, month, and day. Write a
- 1. Display the current year, month, and day.
- 2. The GregorianCalendar class has the setTimeinMillis(long) , which can be used to set a specified elapsed time since January 1, 1970. Set the value to 1234567898765L and display the year, month, and day.
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Additional Engineering Textbook Solutions
Problem Solving with C++ (10th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Modern Database Management
Starting Out with Python (4th Edition)
Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
- - Java - I need another way to fix this code.. pls As we have the error ( class doesn't have a default constructor ) how we can fix this code and make it run?? ( expect by adding an argument inside the constructor )arrow_forward4 Whether or if it's true In the debugger, we can, for example, decide whether to enter or leave a certain method call. In order to find bugs in our code, we can use debuggers, tests, and println() commands.arrow_forwardCan you please answer the whole procedure on the picture? Java programming onlyarrow_forward
- can you write the java code pleasearrow_forwardIn Java, which data type is used to store the following symbol '<' ?arrow_forwardWhat happened after the following Java code is run? - Compiler error - Exception - This final exam is very easy will be displayed - This final exam is easy will be displayedarrow_forward
- please do it only java and attached the outputarrow_forwardCorrect the following wrong statements. In Java, once a variable is declared in a method as local variable, it will be visible and could be used in any other method in the program.arrow_forwardPlease solve this java problem. Please use the expression shown for testing if the class works.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education