Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8979191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:47:36+00:00 2026-06-15T19:47:36+00:00

Actually my java program like… public class Schedule { public static enum RepeatType {

  • 0

Actually my java program like…

public class Schedule {
    public static enum RepeatType {
        DAILY, WEEKLY, MONTHLY;
    }

    public static enum WeekdayType {
        MONDAY(Calendar.MONDAY), TUESDAY(Calendar.TUESDAY), 
        WEDNESDAY(Calendar.WEDNESDAY), THURSDAY(Calendar.THURSDAY),
        FRIDAY(Calendar.FRIDAY), SATURDAY(Calendar.SATURDAY), SUNDAY(Calendar.SUNDAY);

        private int day;

        private WeekdayType(int day) {
            this.day = day;
        }

        public static List<Date> generateSchedule(RepeatType repeatType,List<WeekdayType> repeatDays) {
            // ...
            // here some logic i wrote
        }
    }
}

And i’m calling the method into my Business class like following…

@RemotingInclude
public void createEvent(TimetableVO timetableVO) {
    if ("repeatDays".equals(timetableVO.getSearchKey())) {
        List<Date> repeatDaysList = Schedule.generateSchedule(timetableVO.getRepeatType() , timetableVO.getRepeatDays());
    }
}

And Finally TimetableVO is

@Entity
@Table(name="EC_TIMETABLE")
public class TimetableVO extends AbstractVO {
    // ...
    private RepeatType repeatType;

    // But in this case the method generateSchedule(-,-) was not calling.
    private List<WeekdayType> repeatDays;
    // ... 
}

So my Question is Which one is Better Statement in the Following…

 private List<WeekdayType> repeatDays;

(or)

 // If we give like this `How to Convert Enum type to String` because generateSchedule() method taking enum type value....
 private String repeatDays; 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:47:37+00:00Added an answer on June 15, 2026 at 7:47 pm

    The value of any enumerated type can be converted to a String using the toString() method. You might not have realized (I didn’t at first) that if you declare a RepeatType variable r1, then r1 can be converted to a String using the toString() method E.G. r1.toString()

    This Program:

    public class Main {
    
        /** Creates a new instance of Main */
        public Main() {
        }
    
        public static enum RepeatType {
            DAILY, WEEKLY, MONTHLY;
        }    
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            // TODO code application logic here
            RepeatType r1;
            r1 = RepeatType.DAILY;
            System.out.printf("R1 VALUE: %s\n", r1.toString());
    
            r1 = RepeatType.WEEKLY;
            System.out.printf("R1 VALUE: %s\n", r1.toString());
    
            r1 = RepeatType.MONTHLY;
            System.out.printf("R1 VALUE: %s\n", r1.toString());
    
    
        }
    
    }
    

    Will Output the actual Enum Values as Follows:

    R1 VALUE: DAILY
    R1 VALUE: WEEKLY
    R1 VALUE: MONTHLY
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my java program want TimeZone like GMT(+0530) instead of getting IST Actually my java
I have a webcam (actually 3) and java program to capture the frames. However,
I have written a java program that is actually works as a gui to
Does java has library exception class which means actually not an error, but good
Programming languages like C# or Java feature static methods, despite being heavily object oriented.
I have something like this going on in my Java program: void f(Object o)
Scenario: a program running in a byte code virtual machine like Java or Python,
i've a Java program that print out some text output. Actually my simple PrintOutput
actually I need to write just a simple program in JAVA to convert MySQL
I've got the following simple code: package main; import java.util.concurrent.*; public class Main {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.