Can we declare multiple main() methods in multiple classes.ie can we have each main method in its class in our program?
It is a saying that static methods in JAVA programs should be minimised. What is the reason for this? any problems arise or there is any performance measures to be looked into it.
Latest Answer : Abstract Class:- it has abstract methods and non-abstract methods. Abstract Methods:- this methods has no body. these final and variables of these methods are static, final and protected. ...
I need some more information about interface. For Example there is no any functionality inside the method which is declared in any interface. Then why i want to implement that interface to my class. 2. Statement is an interface. When i say stmt.executeQuery(). I am getting the records in my ResultSet. How it is possible?.. since there is no functionality insid the methods which is declared in Statement Interface. What is happning here?
An idea
Write classes/methods to calculate the totallength of a set of lines given the start and end points taking into account overlapping.E.g.Line 1 start: -1.4, end: 3.2 Line 2start: 2.9, end: 4.1etc..Total length would be:line 1 length = 4.6 line 2 length =1.2, but as line 2 overlaps line 1 by 0.3, therefore length of set is 5.5(rather than 5.8).Please see if you can think of good solution!
one can use different groups of objects in program using collection frame work.for more detail readcollection frame work from java.util pack.
Latest Answer : A collection is a group of object. its provide ways (using classes n interface)for fundamental alteration in the structure and architecture of many element in java.util pakageclasses>>>Collections,AbstractCollection,AbstractList,AbstractMap,AbstractSet,Arraylist,Arrays,Date,Calendar,TimeZone,Stack,StringTokenizer,HashMap,HashSet,HashTable,TreeMap,LinkedList,VectorINterface>>>Collection, ...
If interface & abstract class have same methods & abstract class also not contain any implementation for those methods which one you prefer ?
use abstract class because we implement only requried methods of abstract class but for interface we must implement all methods whether or requried or not
If two overloaded methods are-test(Object xyz) and test(Customer cust)[Assume Customer is a class with member name of type String].Now if we call test(null), which method will be called? why?
How can we inherit the two independent classes in one class? for example, we have two independent classes like Class A and B. I want to inherit the methods of Class A and B.
Let say there are two interfaces like the followinginterface int1{int meth1();}interface int22{int meth1();}ok theni am implementing both of them in a calss as followsclass mycl implements int1,int2{}now as the rule says, if a class implements an interface it must complete its signature.now my questions is that if i define meth1(), as that method is in both interface, may i know how can i define both of that methods.please answer me