What are the legal array index values? What is a bounds error? What is an instance method, and how does it differ from a static method? How many constructors can a class have? Can you have a class with no constructors? If a class has more than one constructor, which of them gets called?
What are the legal array index values?
Legal index values are 0 to size-1. if size is 5 than legal indexes
are 0,1,2,3,4
What is a bounds error?
If we try to access any illegal index in the array than we will get
bound error
What is an instance method, and how does it differ from
a static method?
instance methods are object methods which requires object to invoke
at.. they are availale for each object as differetncopy
static methods are class level methods these are common to all
objects and these methods can be called using class name
How many constructors can a class have?
class can have any number of constructors
Can you have a class with no constructors?
yes we can write but compiler will add the default constructor to
it
If a class has more than one constructor, which of them
gets called?
It depends on the arguments your passing while creating the
object
Get Answers For Free
Most questions answered within 1 hours.