सीधे मुख्य सामग्री पर जाएं

संदेश

HackerRank Java Date and Time | Problem Solution

HackerRank Java Date and Time | Problem Solution   Problem: The  Calendar class  is an abstract class that provides methods for converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week. You are given a date. You just need to write the method,  , which returns the  day  on that date. To simplify your task, we have provided a portion of the code in the editor. Example The method should return   as the day on that date. Function Description Complete the  findDay  function in the editor below. findDay  has the following parameters: int:  month int:  day int:  year Returns string:  the day of the week in capital letters Input Format A single line of input containing the space-separated month, day, and year, respectively, in format. Constraints Sample Input 08 05 201...

HackerRank Java Int to String Problem Solution

HackerRank Java Int to String Problem Solution Problem : You are given an integer   , you have to convert it into a string. Please complete the partially completed code in the editor. If your code successfully converts   into a string   the code will print " Good job ". Otherwise it will print " Wrong answer ".  can range between   to   inclusive. Sample Input 0 100 Sample Output 0 Good job Solution: import  java.io.*; import  java.util.*; public   class  Solution {      public   static   void  main(String[] args) {          /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */        try {            ...

Welcome to Java HackerRank Problem Solution

  Welcome to Java HackerRank Problem Solution   Problem: Welcome to the world of Java! In this challenge, we practice printing to stdout. The code stubs in your editor declare a  Solution  class and a  main  method. Complete the  main  method by copying the two lines of code below and pasting them inside the body of your  main  method. System . out . println ( "Hello, World." ); System . out . println ( "Hello, Java." ); Input Format There is no input for this challenge. Output Format You must print two lines of output: Print  Hello, World.  on the first line. Print  Hello, Java.  on the second line. Sample Output Hello, World. Hello, Java. Solution : public   class  Solution {      public   static   void  main(String[] args) {                        ...