how are methods defined?



how are methods defined?..

Answer / Vinit Kumar Pandey

A method in Java is defined by specifying a name, return type (optional), and parameters. It can also include access modifiers.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the difference between stream and buffer?

1 Answers  


Memory management in JAVA

3 Answers   Tech Mahindra, Wipro,


What is main string [] args?

1 Answers  


Program to output as below formate: 1 2 3 4 5 6 7 8 9 10

4 Answers   Huawei,


How variables are declared?

1 Answers  


What does java ide mean?

1 Answers  


What is difference between equal and == in java?

1 Answers  


Give me an example of array and linked list? Where they can be used?

1 Answers   Ericsson,


Is it possible to write JAVA program without including any of the packages,such as "import java.io.*"; bcoz I instantly wrote a code without "import..." statement and runned the program on command Line & it worked. the code is: class Person { String name; int age; Person(String s,int a) { name = s; age = a; } accept() { System.out.println(name+"Hi!!!!!"); System.out.println(age); } } class Demo { public static void main(Strings args[])throws IOException { String name = args[0]; int age = Integer.parseInt(args[1]); Person p = new Person(name,age); p.accept(); } }

3 Answers  


What is java beans?

1 Answers  


In method overloading ,if i change the return type to Long instead of INT,is the program execute

6 Answers   HCL,


Enlist few advantages of inheritance?

1 Answers  


Categories