| | |
What are static and abstract methods?
![]() |
What is food? What is water? What are the advantages of eating food and drinking water...?
At least make an attempt at understanding things before posting obvious questions whose answers can be easily found out using search engine of your choice.
Let's say that putting a bit of effort on your part and trying to understand things on your own is the first step towards enlightenment, my young padawan.
At least make an attempt at understanding things before posting obvious questions whose answers can be easily found out using search engine of your choice.
Let's say that putting a bit of effort on your part and trying to understand things on your own is the first step towards enlightenment, my young padawan.
I don't accept change; I don't deserve to live.
•
•
Join Date: Nov 2008
Posts: 33
Reputation:
Solved Threads: 2
1. An abstract method is a method that is declared without an implementation,also the abstract method is very useful for design pattern like factory and any class contains this method is abstract class.
For example, java.net.SocketImpl is an abstract class. It is used to create both client and server sockets.
2. static method
tatic means one per class and not for each object you can use them without creating an instance of a class.
For example java.lang.Math, this class has all static fields and methods. Also a singleton class uses static method is very useful for resource pools (database connection,etc.....).
Albert
For example, java.net.SocketImpl is an abstract class. It is used to create both client and server sockets.
2. static method
tatic means one per class and not for each object you can use them without creating an instance of a class.For example java.lang.Math, this class has all static fields and methods. Also a singleton class uses static method is very useful for resource pools (database connection,etc.....).
Albert
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
> people who find this query very obvious and basic,please don't
> respond.Please don't make personal attacks.
You are too oblivious to realize that you never asked a query; it was a request for someone else to do your homework. Nowhere in your post have you shown any traces of having put any effort to solve the problem at hand.
And BTW, dear `Ninad16', don't PM me telling me what I should and shouldn't do. You can't tell someone to *not* reply to your threads as long as they replies follow the forum rules and stay on topic. And yes, I felt a need to chastise an *obvious* question since you were violating a forum rule and I felt it necessary to put you on track. Read the forum announcements.
> respond.Please don't make personal attacks.
You are too oblivious to realize that you never asked a query; it was a request for someone else to do your homework. Nowhere in your post have you shown any traces of having put any effort to solve the problem at hand.
And BTW, dear `Ninad16', don't PM me telling me what I should and shouldn't do. You can't tell someone to *not* reply to your threads as long as they replies follow the forum rules and stay on topic. And yes, I felt a need to chastise an *obvious* question since you were violating a forum rule and I felt it necessary to put you on track. Read the forum announcements.
I don't accept change; I don't deserve to live.
![]() |
Similar Threads
- 8 Puzzle using A_star with Manhattan heuristic (Java)
- A question about virtual methods. (C#)
- how is abstact class different from Interface?? (Java)
- Need help with T/F and Multiple Choice (Java)
- Why am I getting this error? (C++)
- Implmenting Interfaces (Java)
- Help figuring out (C++)
- I lack focus... (Java)
- java problem with creating arrays (Java)
- fairly basic c++ code that demonstrates many aspects (C++)
Other Threads in the Java Forum
- Previous Thread: KeyListener
- Next Thread: play incompleted music file
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary blackberry block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working






