Java
  1. what is static keyword in java?

    Static keyword in java is used for memory management only.The static keyword can be used in variable and method. we create static keyword on variable incase lets assume that there are many student in college.They are in same college. If we have to write all student college name, it is waste of time and memory if we declared college name static then we need not have to write college name for everystudent,we use static variable at once and use it for all of the student.

    For method ,we need not have to create object instance ,for student.age() wherer student is class and age is static method

  2. Why is the Java main method is static?

    For calling a static method, it is not necessary for creation of the object which save the wastage of the memory Tips:
    1. only static data members can be initalized in static method
    2. Don't create a object for calling a static method
    3. The jvm calls a main method during a program execution so that creation of the object is not nessary which save memory