Home Answers Viewqa Java-Beginners explain this method

 
 


soso ce
explain this method
0 Answer(s)      2 years and 4 months ago
Posted in : Java Beginners

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 ");
leadspaces = cal.get(Calendar.DAYOF_WEEK);
int dayofmonth = days[m];
if (cal.isLeapYear(cal.get(Calendar.YEAR)) && m == 1){ dayofmonth++;}
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 Pages:
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
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
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
Explain about threads:how to start program in threads?
Explain about threads:how to start program in threads?  import... creates the main thread and calls the program's main method. Additional thread.... Start, run, stop. Threads can be started using start method, the start
Please write code for this program in java and Explain it ? pl'sssssssss
Please write code for this program in java and Explain it ? pl'sssssssss  Question: We are given an array of 2n integers wherein each pair... that were ever alive at one time. Write a method to compute this, given the above
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, ServletContext interface is a window for a servlet to view it?s environment. A servlet can use this interface to get information
getChars method
**); System.out.println(tempCharArray); } } plz explain the bold ones
Explain WML
Explain WML  hii, What is WML?   hello, 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 to HTML
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
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 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
Java Script location.replace method
didnt understand the meaning of this? Could you pls explain? awaiting for ur
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
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 this prog
please explain this prog  can u explain this import java.io.*; class SString{ public static void main(String ar[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in
Explain push and pop
Explain push and pop   hii, Define push and pop?   hello, 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
method - Java Beginners
method  Method Sir, I am confusing in this sentence and did not understood clearly about a method that returns object and reference and unable... in the Permissions class if you explain the underline sentence and give
Explain Linked List
Explain Linked List   hello, What is Linked List ?   hello, Linked List is one of the fundamental data structures. It consists of a sequence of nodes, each containing arbitrary data fields pointing to the next
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
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...(" "); } } System.out.println(); } } iam explain whole code exept
please explain this prog
please explain this prog  import java.io.*; class Studar{ public static void main(String ar[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("how many
java explain - Java Beginners
of diagram (heap and stak) also explain how the code arrived at the results in b, b1
When is java main method called?
When is java main method called?  When is java main method called? Please explain the main method in Java with the help of code.   In a java class, main(..) method is the first method called by java environment when
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
what is web .config method
,call the service method and finally destroy it. Servlet config is an object...? For overriding init()method any rules are there There are no necessary conditions to override this particular method. In case you are overridding init
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
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
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
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
Use of rewind method in java.
Use of rewind method in java.       In this tutorial, we will explain the use of rewind() method of Buffer class. The ByteBuffer ...;In this example, The rewind method reset the position of buffer at zero. So you can
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
Explain the parameters of Font class constructor.
Explain the parameters of Font class constructor.  Explain the parameters of Font class constructor.   Java Font class: Font(String name,int style,int size): It creates a new Font from the specified name, style
Please explain me the flow of this program..
Please explain me the flow of this program..  // Substring replacement. class StringReplace { public static void main(String args[]) { String org = "This is a test. This is, too."; String search
FTPClient : Get System Type
This section explain how to get system type by using method of FTPClient class in java
HQL in hibernate ? Explain the use of HQL.
HQL in hibernate ? Explain the use of HQL.  What is the HQL in hibernate ? Explain the use of HQL.   HQL stands for Hibernate Query Language, provided by Hibernate. It is minimal object oriented, similar to SQL
What is the difference between GET and POST method?
What is the difference between GET and POST method?  In PHP, both GET and POST method serves the same feature to get the data in variable. Still there is a lots of difference between the both. Can anyone please explain
please explain me the flow of this program
please explain me the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized
Servlet service method - Java Beginners
Servlet service method  Hi EveryOne , I have a simple problem but i dont know whether the approach me going is correct or not, i will explain u my problem I have two classes one is servlet

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.