answersLogoWhite

0


Best Answer

If you mean Java, you can get the documentation for the Integer class (with an uppercase "I") here:

http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Integer.html

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the constructor method of integer class?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you call an abstract class from main method?

An abstract class cannot have a constructor and hence you cannot invoke the constructor of the class - i.e., you can instantiate an abstract class and hence you cannot call the constructor of an abstract class.


Why you don't use void in constructor function although it doesn't return any value?

Return a value in the constructor is senseless, because a constructor is used to initialize a object instance and not to perform a task or a operation. When we call a constructor we used a sentence like this: MyClass var = new MyClass(); Then when we execute the above line the constructor return ('create') a new object of the type 'MyClass'. If this call could return an other type, for example an Integer, the constructor is considered a normal method, and if there are not more constructors a empty default constructor for MyClass is defined by the java compiler. public class MyClass{ // The java compiler will insert a real constructor here public Integer MyClass(){ //This isn't a constructor, only a simple method return new Integer(1); } }


Does java class must have public method?

no you can have a class with no public methods and even with a a private constructor public class Example { //constructor private Example(){ } }


What is a constructor and its mandatory to use constructor in a class?

Constructor is a special block of code similar to the method that is used to initialize the state of objects. If you do not define a constructor in a class, Java compiler automatically put a default constructor in the class.


Can abstract class have constructors?

A constructor of a class in invoked when a object of that class is created. As an abstract class can't have an object, so we can't create a constructor of the abstract class. But we can create a constructor of a concrete subclass of that abstract class and we have to pass the object of that concrete subclass to the abstract class.

Related questions

How do you call an abstract class from main method?

An abstract class cannot have a constructor and hence you cannot invoke the constructor of the class - i.e., you can instantiate an abstract class and hence you cannot call the constructor of an abstract class.


Why you don't use void in constructor function although it doesn't return any value?

Return a value in the constructor is senseless, because a constructor is used to initialize a object instance and not to perform a task or a operation. When we call a constructor we used a sentence like this: MyClass var = new MyClass(); Then when we execute the above line the constructor return ('create') a new object of the type 'MyClass'. If this call could return an other type, for example an Integer, the constructor is considered a normal method, and if there are not more constructors a empty default constructor for MyClass is defined by the java compiler. public class MyClass{ // The java compiler will insert a real constructor here public Integer MyClass(){ //This isn't a constructor, only a simple method return new Integer(1); } }


Does java class must have public method?

no you can have a class with no public methods and even with a a private constructor public class Example { //constructor private Example(){ } }


What is a constructor and its mandatory to use constructor in a class?

Constructor is a special block of code similar to the method that is used to initialize the state of objects. If you do not define a constructor in a class, Java compiler automatically put a default constructor in the class.


Can abstract class have constructors?

A constructor of a class in invoked when a object of that class is created. As an abstract class can't have an object, so we can't create a constructor of the abstract class. But we can create a constructor of a concrete subclass of that abstract class and we have to pass the object of that concrete subclass to the abstract class.


A subclass can call constructor method defined by its super class?

True


Why constructor in Java doesn't have any return type?

The constructor of a Java class is not an ordinary method. Its purpose is not to return any value. The purpose of the constructor is to instantiate the class which it does. Since, the purpose of a constructor is only to instantiate and initialize its class and not anything else, it does not have a return type. All it does is creates an object of that class.


Why constructor rather than classes in java?

Constructor is not an alternative to class. In Java, you create classes; the classes contain methods - including the constructor, which can be viewed as a special method. If you want to have a constructor, you need a class that surrounds it, so it's not one or the other.


What is super class construter?

A superclass constructor is the constructor of the superclass. Constructor is a special method that runs automatically as soon as a method is instantiated (created). Superclass is the class on which a certain class is based. This is what is known as "inheritance" - classes can be based on other classes. This is done as a way of organizing classes, and for code reuse - that is, reducing the amount of duplicate code.


.....will be automatically Invoked when an object is created?

The Class object is automatically created by the JVM when an object is created. The Class object provides information about the Class and is primarily used by the IDEs and factory classes. The method that is automatically called when an object is created is called a constructor. In Java, the constructor is a method that has the same name as the class.


What is mean constructor in java?

A parameterized constructor in java is just a constructor which take some kind of parameter (variable) when is invoked. For example. class MyClass { //this is a normal constructor public MyClass(){ //do something } //this is a parameterized constructor public MyClass(int var){ //do something } //this is another parameterized constructor public MyClass(String var, Integer var2){ //do something } }


Can Explain with an example to the default constructor?

The following example shows a Lamborghini class with two constructors: class Lamborghini { Lamborghini() { } Lamborghini(String name) { } } Will the compiler put in a default constructor for the class above? "No!" What about for the following variation of the class? class Lamborghini { Lamborghini(String name) { } } Now will the compiler insert a default constructor? "No Again!" What about this class? class Lamborghini { } Now we're talking. The compiler will generate a default constructor for the preceding class, because the class doesn't have any constructors defined. OK, what about this one below? class Lamborghini { void Lamborghini() { } } You might be tempted to say that, the compiler won't create one, since there already is a constructor in the Lamborghini class? Take another look at the Lamborghini class. What's wrong with the Lamborghini() constructor? It isn't a constructor at all! It's simply a method that happens to have the same name as the class. Remember, the return type is a dead straight way to tell us that we're looking at a method, and not a constructor. So, here again the compiler will put the default no-arg constructor in the class.