Explain, why the constructor is required in implemented
class?

Answer Posted / snehaaa

when u have the class name like bicycle,how u'l initialize the values for bicycle with different 1 parameters,2 parameters,
3 parameters by using object?. for that u'l create example like 3 parameter constructors -> bicycle(speed,wheels,gear)and cal this constructor like bicycle b=new bicycle(10,2,4); this is use of constructor to initialize the values for class

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there any way to find whether software installed in the system is registered by just providing the .exe file? I have tried the following code but its just displaying the directory structure in the registry. Here the code : package com.msi.intaller; import java.util.Iterator; import ca.beq.util.win32.registry.RegistryKey; import ca.beq.util.win32.registry.RootKey; public class RegistryFinder { public static void main(String... args) throws Exception { RegistryKey.initialize(RegistryFinder.class.getResource("jRe gistryKey.dll").getFile()); RegistryKey key = new RegistryKey(RootKey.HKLM, "Software\\ODBC"); for (Iterator subkeys = key.subkeys(); subkeys.hasNext();) { RegistryKey subkey = subkeys.next(); System.out.println(subkey.getName()); // You need to check here if there's anything which matches "Mozilla FireFox". } } }

1446


What is a parameter in java?

629


define the terminology association.

726


What is the order of arraylist in java?

711


What is a java predicate?

615






Explain the difference between abstract classes and interfaces in java?

717


when you will synchronize a piece of your code? : Java thread

632


What is hash in java?

604


How do you generate random numbers in java?

620


Is sizeof a keyword in java programming?

722


Is array an object in java?

636


Why use string handling in Java?

662


List types of storage classes in java?

718


What is Garbage Collection in Java

694


What does  mean in regex?

657