explain this method

explain this method

i hope any one can explain this method ` private void showMonth(int m, int y) {
        int lead_spaces = 0; 
          if (m < 0 || m > 11) {
        System.out.println("It should be 1 to 12"); 
            } 
         else { 
             System.out.println(); 
             System.out.println("    " + months[m] + " " + y); 
             System.out.println();
             GregorianCalendar cal = new GregorianCalendar(y, m, 0);
             System.out.println("Su Mo Tu We Th Fr Sa "); 
             lead spaces = cal.get(Calendar.DAY OF_WEEK); 
             int day of month = days[m]; 
             if (cal.isLeapYear(cal.get(Calendar.YEAR)) && m == 1){ day of month++;} 
             for (int i = 0; i < lead_spaces; i++) { 
                 System.out.print("   "); 
                  }  

    for (int i = 1; i <= day_of_month; i++) {  
            if (i < 10) System.out.print(" ");  
              System.out.print(i);  
            if ((lead_spaces  + i) % 7 == 0) {  
               System.out.println();  
                 }   
               else {
               System.out.print(" ");  
            }  } 
         System.out.println();   }  }  



  private static void doSimpleDateFormat() {  
    Calendar now = Calendar.getInstance();  
    SimpleDateFormat formatter = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");  
    System.out.print(" \n It is now : " + formatter.format(now.getTime()));  
     System.out.println();  
          }  


    public static void main(String[] args) {  
        String mo = JOptionPane.showInputDialog("Month");  
        String ye = JOptionPane.showInputDialog("Year");  
        int mon = new Integer(mo).intValue();  
        int yea = new Integer(ye).intValue();  
          EnglishCalendar k = new EnglishCalendar();  
              k.showMonth(mon - 1 , yea);  
         doSimpleDateFormat();

} 

plz help me
View Answers

Ads









Related Tutorials/Questions & Answers:
explain this method
explain this method   i hope any one can explain this method ` private void showMonth(int m, int y) { int lead_spaces = 0; if (m < 0 || m > 11) { System.out.println("It should be 1 to 12
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
Advertisements
method
method  can you tell me how to write an abstract method called ucapan() for B2 class class A2{ void hello(){ system.out.println("hello from A2"); }} class B2 extends A2{ void hello(){ system.out.println("hello from B2
please explain this prog
please explain this prog  can u explain this import java.io.... InputStreamReader(System.in) allows the user to input string on the console. The method.... And using println() method displayed the entered value on the console. Hope
Explain factories design?
Explain factories design?  Hi, I can't understand the concept of factories design, if you can explain it to me in simple words, i would be grateful. Thanks..   Hello, Factory Method is a creational pattern
ModuleNotFoundError: No module named 'explain'
ModuleNotFoundError: No module named 'explain'  Hi, My Python... 'explain' How to remove the ModuleNotFoundError: No module named 'explain... to install padas library. You can install explain python with following command
Explain types of java programs
Explain types of java programs  Explain types of java programs   Types of Java Programs: Standalone Applications Web Applications Enterprise Applications Console Application Web services
please explain this program
please explain this program  public class MainClass { public static void main(String[] args) { System.out.println("Java
please explain this prog
please explain this prog  import java.io.*; class Studar{ public.... The InputStreamReader(System.in) allow the user to input and the method readLine.... The method Integer.parseInt(br.readLine()), reads the marks of each subject
Please explain Hibernate Sessionfactory.
Please explain Hibernate Sessionfactory.  Hi there, Please explain Hibernate session factory in detail. I have just started learning hibernate so i..., the tutorials here will help you learn Hibernate and will explain about hibernate
what is the meaning of this or explain this
what is the meaning of this or explain this  List<Object[]> list=query.list();   Hi Friend, It will return the query values in the form of list. For more information, visit the following link: Hibernate
explain servletconfig with programiing example?
explain servletconfig with programiing example?  explain servletconfig with programiing example?   ServletConfig is a servlet configuration object used by a servlet container used to pass information to a servlet during
Please explain @interface with an example
Please explain @interface with an example  Here is the code snippet: @Retention(RUNTIME) @Target({ FIELD }) public @interface InjectProperty... explain what does all these mean? How all these work
Please explain @interface with an example
Please explain @interface with an example  Here is the code snippet: @Retention(RUNTIME) @Target({ FIELD }) public @interface InjectProperty... runnable; where Runnable is an interface. Could you please explain what does
Explain Hibernate Relationships with example.
Explain Hibernate Relationships with example.  Hello, Please explain various hibernate relationships. And if you can provide some examples that would be a great help.. Thank you....   Hi, Hibernate relational
can any one explain this
can any one explain this  class Clidder { private final void flipper() { System.out.println("Clidder"); } } public class Ex3 extends Clidder { public final void flipper() { System.out.println
Explain the concept of thread priorities in Java.
Explain the concept of thread priorities in Java.  Explain the concept of thread priorities in Java
program on helloworld :explain
a new class "Hello". The main Method: The main method is the entry point in the Java program and java program can't run without main method. JVM calls the main method of the class. This method is always first thing that is executed
program on helloworld :explain
". The main Method: The main method is the entry point in the Java program and java program can't run without main method. JVM calls the main method of the class. This method is always first thing that is executed in a java program. Here
can you explain ?
can you explain ?  my dear can you teel me the explaintion for this code i need it GregorianCalendar cal = new GregorianCalendar(y, m, 0...(); } } iam explain whole code exept this part can you help
Please explain the logic....
Please explain the logic....  class A1 { } class B extends A1 { } public class ComingThru { static String s = "-"; public static void main(String[] args) { A1[] aa = new A1[2]; B[] ba = new B[2
Explain the persistence class in hibernate?
Explain the persistence class in hibernate?  What is persistence class in hibernate?   Persistence class are simple POJO classes in an application. It works as implementation of the business application for example
ModuleNotFoundError: No module named 'django-explain'
ModuleNotFoundError: No module named 'django-explain'  Hi, My... named 'django-explain' How to remove the ModuleNotFoundError: No module named 'django-explain' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'explain_sklearn'
ModuleNotFoundError: No module named 'explain_sklearn'  Hi, My... named 'explain_sklearn' How to remove the ModuleNotFoundError: No module named 'explain_sklearn' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keras-explain'
ModuleNotFoundError: No module named 'keras-explain'  Hi, My... 'keras-explain' How to remove the ModuleNotFoundError: No module named 'keras-explain' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'keras-explain'
ModuleNotFoundError: No module named 'keras-explain'  Hi, My... 'keras-explain' How to remove the ModuleNotFoundError: No module named 'keras-explain' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'path-explain'
ModuleNotFoundError: No module named 'path-explain'  Hi, My Python... 'path-explain' How to remove the ModuleNotFoundError: No module named 'path-explain' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'tf-explain'
ModuleNotFoundError: No module named 'tf-explain'  Hi, My Python... 'tf-explain' How to remove the ModuleNotFoundError: No module named 'tf-explain' error? Thanks   Hi, In your python environment you
Explain various access modifiers and their visibility.
Explain various access modifiers and their visibility.  Explain various access modifiers and their visibility.   Please visit the following link: Java Access Modifiers
method and function difference
method and function difference  so far, I understand that method and function are the same thing... but is there any difference between the two terms? Please explain me if both are different terms. Thanks in advance
What is a vector in Java? Explain with example.
What is a vector in Java? Explain with example.  What is a vector in Java? Explain with example.   Hi, The Vector is a collect of Object that implement AbstractList class. It autometically increases the list length

Ads