Latest Tutorials| Questions and Answers|Ask Questions?|Site Map

Have Programming Question? Ask it here!

1 Answer(s)      4 years and 6 months ago
Posted in : Java Beginners

how to create a constructor to set the month using the first three letters in the name of
the month as three arguments

View Answers

February 26, 2010 at 10:29 PM

public class Month {

char char_1;
char char_2;
char char_3;

Month(char one,char two,char three){
this.char_1 = one;
this.char_2 = two;
this.char_3 = three;
public static void main(String[] args) {
Month month = new Month('j','a','n');


Related Tutorials/Questions & Answers: