Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What do u mean by method and also contructer in java ?

Answer Posted / hira ratan sharma

Java methods are similar to functions or procedures in other
programming languages.

Every Java program must have one main() method.

Here is the main() method from a Java program which prints
"Hello World":

public static void main (String[] args) {
// This Java program prints "Hello World!"
System.out.println{"Hello World!");


A constructor creates an Object of the class that it is in
by initializing all the instance variables and creating a
place in memory to hold the Object. It is always used with
the keyword new and then the Class name. For instance, new
String(); constructs a new String object.

COnstructors are basically used to initialize the attributes
of the class.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

os is developed in c no java is more secured then c na why dont the os developed is developed using java

4229


What is private static class in java?

1016


What is the implementation of destroy method in java. Is it native or java code?

964


Why hashcode is used in java?

972


What is a final class ?

1181


What is difference between fail-fast and fail-safe?

1238


How to change value in arraylist java?

1177


What is the current version of java?

1038


What is not object oriented programming?

949


Define how does a try statement determine which catch clause should be used to handle an exception?

1161


Write a program to find maximum and minimum number in array?

1001


Do you know how to reverse string in java?

1153


Do we need to manually write Copy Constructor?

1033


What is unicode in java?

929


What are wrapper classes in java?

1069