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









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
Explain - LDAP
Explain LDAP  Any one explain about LDAP ? and also explain about JNDI what relation b/w this two
Explain ServletContext.
Explain ServletContext.  Explain ServletContext.   Hi, Here is the answer,ADS_TO_REPLACE_1 ServletContext interface is a window for a servlet to view it?s environment. A servlet can use this interface to get
Explain WML
Explain WML  hii, What is WML?   hello,ADS_TO_REPLACE_1 WML stands for Wireless Markup Language. It is a simple language used to create applications for small wireless devices like mobile phones. WML is analogous
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 normalization concept?
Explain normalization concept?  Explain normalization concept
Explain unescape() and escape() in JavaScript?
Explain unescape() and escape() in JavaScript?  Explain unescape() and escape() in JavaScript
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
Explain struts.jar file - Struts
Explain struts.jar file   Hi friends am new to java. I read jar file means collection of java files. For executing struts application what are the necessary jar files. " struts.jar " file contains what. can u explain
Explain Transparent Persistence - Hibernate
Explain Transparent Persistence   Hi Friends, Can u plz explain Transparent Persistence briefly  Hi Follow this link to find solution of your problem... http://www.roseindia.net/jdotutorials/jdo
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
Explain push and pop
Explain push and pop   hii, Define push and pop?   hello,ADS_TO_REPLACE_1 The insertion operation is referred to as push and the deletion operation is referred to as pop
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
Explain Linked List
Explain Linked List   hello, What is Linked List ?   hello,ADS_TO_REPLACE_1 Linked List is one of the fundamental data structures. It consists of a sequence of nodes, each containing arbitrary data fields pointing
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
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
Explain about Type Juggling in php?
Explain about Type Juggling in php?  Explain about Type Juggling in php
Explain the ternary conditional operator in PHP?
Explain the ternary conditional operator in PHP?  Explain the ternary conditional operator in PHP
What is outer join?Explain with examples.
What is outer join?Explain with examples.  What is outer join?Explain with examples
Explain about Cross site scripting?
Explain about Cross site scripting?  Explain about Cross site scripting
Explain the concept of thread priorities in Java.
Explain the concept of thread priorities in Java.  Explain the concept of thread priorities in Java
java explain - Java Beginners
of diagram (heap and stak) also explain how the code arrived at the results in b, b1
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
Flex Trace Method, Trace function in Flex
and terminate button stops the debugging session. Flex Trace Method Example... the application like below. Clicking  the button calls the init() method which calls two trace methods. The message will be printed by trace() method can
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
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
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
method inside the method??
method inside the method??  can't we declare a method inside a method in java?? for eg: public class One { public static void main(String[] args) { One obj=new One(); One.add(); private static void add
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
get method
get method   how to use get method: secure method is post method and most of use post method why use a get method
plz explain me the output of program - Java Beginners
plz explain me the output of program  Hi friends, can u please explain me the output of below program with proper explanation of each and every line... in ThisDemo.java class. The method show() of void type contains three parameters a,b
Method
Method       In this section, we will explore the concept of method in the reference of object oriented... and behaviors are defined by methods. Method : An brief introduction Methods

Ads