19/12/24 ----------- Q)How to display data on the console(Monitor) in a Java program? =>by using two library methods 1)println() 2)print() Note:- println() method after displaying data, it prints a blank new line. Where as, print() doesn't Q)Is mian a library method? =>No. => main is user defined method. Q)Which performs a task in a Java application? =>method(Not only main method. But also other user defined methods). For eg. deposit() withdraw() transfterFunds Q)What is a method? =>Named block of code that perfoms a specific task when called is nothing but a method. Q)What are the keywords used in the above program? 1)class 2)public 3)static 4)void Note:- A pre-defined word whose meaning is already explained to the compiler is nothing but a keyword Q)What is the user defined class in the above program? HelloWorld Q)What are the library classes used in the above program? 1)String 2)System Note:- classes are of two types. 1)user defined classes 2)library classes (API classes) =>Java application developer own Java class is known as a user defined class. =>Pre-defined classes that come along with JDK's installation are known as library classes. Q)Which is the user defined method in the above program? =>main method Q)Which is the library method in the above program? =>println() Q)What is the signature of main method? =>method name and parameters put together form the singnature of any Java method. method signature=method name+parameters =>main method in a Java class has the following signature. main(String []) Note:- main that takes String array as parameter is nothing but the signature of main method. Q)Why is main method declared public? =>to fecilitate the JVM to call the main method, it is declared public. OR =>To give access permission to the JVM to call the main method, it is declared public. Q)Why is main method declared static? =>To make the JVM call the main method without the need of creating the object, main method is declared static.