answersLogoWhite

0

Which is the most usable method or constructor in java?

Updated: 8/18/2019
User Avatar

Wiki User

12y ago

Best Answer

There is no comparison between methods and constructors. They are both present for a reason and each has its own purpose.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which is the most usable method or constructor in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is static java most commonly used for?

Static java method is the same as a static variable. They belong to a class and not an object of that class. If a method needs to be in a class, but not tied to an object, then one uses static java.


Difference between function and method?

Constructor will be automatically invoked when an object is created whereas method has to be called explicitly. Constructor needs to have the same name as that of the class whereas functions need not be the same. * There is no return type given in a constructor signature (header). The value is this object itself so there is no need to indicate a return value. * There is no return statement in the body of the constructor. * The first line of a constructor must either be a call on another constructor in the same class (using this), or a call on the superclass constructor (using super). If the first line is neither of these, the compiler automatically inserts a call to the parameterless super class constructor.


How does Java decide which method with the same signature to use when the method exists in several levels of a class hierarchy?

Java uses a process called method dispatch, where the most specific version of the method is chosen at runtime. It starts by searching for a matching method in the class where the object is declared. If it finds a match, it will execute that method. If not, it will search the superclasses in the hierarchy until it finds a match or reaches the top of the hierarchy. If multiple methods with the same signature are found at the same level, a compile-time error occurs.


Attributes and methods of uppercase in java?

In Java toUppercase() is a method of the class String: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toUpperCase()


What constructor won most formula 1 races?

Ferrari


How to write a java program that determines the number of prime numbers less than N which is given by the user?

where to start? do you have an algorithm and just want to implement it in java? depends on how big N is, as that will determine which method is most efficient


What is java 7?

Java 7 is the most current version of Java. Many movies and games use Java.


What is the difference between overloading and overriding methods in object?

Here are some of the most common differences between both of them. If you are working in Java for more than 1 year, you might be familiar with all of them but any way its good revision: 1) First and major difference between Overloading and Overriding is that former occur during compile time while later occur during runtime. 2) Second difference between Overloading and Overriding is that, you can overload method in same class but you can only override method in sub class. 3) Third difference is that you can overload static method in Java but you can not override static method in Java. In fact when you declare same method in Sub Class it's known as method hiding because it hide super class method instead of overriding it. 4) Overloaded methods are bonded using static binding and Type of reference variable is used, while Overridden method are bonded using dynamic bonding based upon actual Object. 5) Rules of Overloading and Overriding is different in Java. In order to overload a method you need to change its method signature but that is not required for overriding any method in Java.


When a variable is declared within a method it ceases to exist when the method ends true or false?

It really depends on the programming language, but in general, this is true. In Java, for example, the scope of a variable declared in a method is the method - outside of the method it is inaccessible, and once the method finishes execution, the variable disappears.


What is acess spacifier in java?

An Access Modifier is a key word in java that determines what level of access or visibility a particular java variable/method or class has. There are 4 basic access modifiers in java. They are: 1. Public 2. Protected 3. Default and 4. Private Private is the most restrictive access modifier whereas public is the least restrictive. Default is the access protection you get when you do not specifically mention an access modifier to be used for a java object.


Is java is virus free?

Answer: NO!. Most viruses are written in Java and C++.


Which is correct useable or usable?

useable and usable are both accepted, yet the proper spelling is usable. (According to most dictionaries.) I even spelled check it and useable is red so usable would be correct.