Click here to Skip to main content
15,888,351 members
Home / Discussions / Java
   

Java

 
AnswerRe: problem in hibernate mysql connecting Pin
Bhalchandra Sawant9-Apr-14 20:55
Bhalchandra Sawant9-Apr-14 20:55 
QuestionHow to connect into database and show the form from database Pin
Ah Nam Ge27-Mar-14 18:22
Ah Nam Ge27-Mar-14 18:22 
AnswerRe: How to connect into database and show the form from database Pin
Richard MacCutchan27-Mar-14 22:26
mveRichard MacCutchan27-Mar-14 22:26 
GeneralAbstract Classes in Java Pin
akcreative25-Mar-14 0:29
akcreative25-Mar-14 0:29 
GeneralRe: Abstract Classes in Java Pin
Richard MacCutchan25-Mar-14 1:30
mveRichard MacCutchan25-Mar-14 1:30 
GeneralRe: Abstract Classes in Java Pin
jschell25-Mar-14 13:29
jschell25-Mar-14 13:29 
GeneralRe: Abstract Classes in Java Pin
Bernhard Hiller25-Mar-14 21:39
Bernhard Hiller25-Mar-14 21:39 
GeneralRe: Abstract Classes in Java Pin
Member 1043154927-Mar-14 0:21
Member 1043154927-Mar-14 0:21 
An Abstract class is a class that is declared as abstract. It may or may not include abstract methods.
We must declare Abstract class and Abstract methods with the key word abstract.
Abstract classes cannot be instantiated, means we can't create an object to Abstract class. We can create through Subclasses to Abstract classes.

Abstract methods in the sense without body..i.e there is no implementation right..

So in that case JVM does not know how much memory it has to allocate for that abstract method because abstract method does not have body implementation.

So JVM will not able to allocate memory for the abstract methods when the time of creating instance to Abstract class.

So JVM unable to create the instance to Abstract class. So that we can't create the object for the Abstract class.

If we use little sense, Abstract method is a non-static(not allows static) method, if we are allowed to create object for abstract method we can invoke that abstract method, which can not be executed. What is the use of it to invoking the unimplementation method.

Hence to restrict calling abstract method compiler will not allow instantiation abstract class.

Ok, Good , you may raise a question…In Abstract class not only Abstract methods we can create Concrete methods also which is having the implementation, so why, In that case also we can't create the instance for the Abstract class. Why because the abstract keyword simply indicates to JVM that the class cannot be instantiated.

Hence the designers of Java made the JVM that when it find abstract keyword for any class then JVM can't create the instance for that class.

Abstraction is just an Idea, there is no physically exists.

Above I written a statement Abstract method is a non-stattic method. Why Abstract method has not allows static modifier?

If we declare Abstract method as static , it is identified at the time of class loading and further can be invoked which can not be instantiated.
So ,Abstract method can not declare as static. If we declare it gives the compile time error: Illegal combination of modifier: abstract and static.
You know the Java class loader is also an abstract class...

Ok boss, I heard abstract class has constructor...Is it Right...

yes, absolutely, then why constructor ?

simple answer is for initializing the sub class...

There is a good reason behind this ,I will explore this in detail in my next post .

Hope its may help you...

give u r valuable comment to correct my knowledge, in case i'm wrong in this section...
if you have any doubts also write your doubt as a comment.
Thanks.
GeneralRe: Abstract Classes in Java Pin
Member 1071490931-Mar-14 23:27
Member 1071490931-Mar-14 23:27 
Questionabout pointers Pin
Member 1030303423-Mar-14 17:39
Member 1030303423-Mar-14 17:39 
AnswerRe: about pointers Pin
Richard MacCutchan23-Mar-14 23:04
mveRichard MacCutchan23-Mar-14 23:04 
AnswerRe: about pointers Pin
Member 1043154927-Mar-14 0:25
Member 1043154927-Mar-14 0:25 
QuestionBrute force Convex Hull Pin
not_20-Mar-14 11:57
not_20-Mar-14 11:57 
AnswerRe: Brute force Convex Hull Pin
Kenneth Haugland20-Mar-14 12:57
mvaKenneth Haugland20-Mar-14 12:57 
QuestionByte aligned bitmap code compression Pin
Member 1068441319-Mar-14 19:04
Member 1068441319-Mar-14 19:04 
AnswerRe: Byte aligned bitmap code compression Pin
Richard MacCutchan19-Mar-14 23:26
mveRichard MacCutchan19-Mar-14 23:26 
Questionhelp Pin
Member1067140219-Mar-14 0:58
Member1067140219-Mar-14 0:58 
AnswerRe: help Pin
Richard MacCutchan19-Mar-14 3:53
mveRichard MacCutchan19-Mar-14 3:53 
Questionexe file Pin
Member 1003910918-Mar-14 23:57
Member 1003910918-Mar-14 23:57 
AnswerRe: exe file Pin
Bernhard Hiller19-Mar-14 0:46
Bernhard Hiller19-Mar-14 0:46 
SuggestionRe: exe file Pin
Richard Deeming19-Mar-14 2:02
mveRichard Deeming19-Mar-14 2:02 
Questionopening .exe file Pin
Member 1003910918-Mar-14 22:59
Member 1003910918-Mar-14 22:59 
AnswerRe: opening .exe file Pin
TorstenH.24-Mar-14 4:55
TorstenH.24-Mar-14 4:55 
GeneralRe: opening .exe file Pin
Member 1003910925-Mar-14 1:03
Member 1003910925-Mar-14 1:03 
GeneralRe: opening .exe file Pin
TorstenH.25-Mar-14 4:11
TorstenH.25-Mar-14 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.