answersLogoWhite

0

Constructors have the same name as the class itself and they do not specify a return type, not even void because they return the instance of the class itself.

Because constructors have the same name as the class then they allow method overloading and also save memory and execution time of program.

Program release memory of constructors function after using this function and it reduce program complexity.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What the advantages of using the Java Collection Framework?

The main advantage is that you don't have to implement those collections yourself. Java provides very efficient implementations for dozens of collections.


What is the advantage of using telnet in router configuration?

The main advantage of using this is remote access on the network.


Can you print some message on the console without using main in java?

By using the static block


Can you run java program without applying main method?

yes we can run java program without using main. we can run program by declaring the variable static..


Why java called as platform independent?

Java is called as platform independent because it uses the WORA(Write Once and Run Anywhere) principle. Java programming language is designed to be run under any OS and that is the main advantage of it.


What are the dis advantage of visual basic?

Well... One of the main Disadvantages are that you are limited to the application can do as an example in Java, if you are making a calculator the highest value in java is 2,147,483,647 and cannot calculate more than that...


Why main is used in java?

In java need main() method. without main() in java we won't run the java programe main() signals the entry point to the program - it tells the Java Virtual Machine which is the first program that should be executed.


Why we can't create a os using java?

Sure, We can design OS using java, c++ and even with C also but the main reason is the code will be very hectic and very lengthy tooo


How to write java program without using main method?

Java program without mainWe need a main method for executing a program.But YES we can write a program without using main() method.TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main methodWhoa!!!!! we are done.;)


What is the advantage of using your own money on your business?

The main advantage is that you don't have to pay interest on a loan to support your business.


Who invoke main function in java?

The Java Runtime Environment invokes main methods.


Which api used in java?

The Java API is the API for the main Java Library.