Why java does not force to declare atleast one abstract method

hi,
i can define an abstract class without declaring any abstract method in that class. But why wud i do this ? i mean when i have decided that a particular class should be inherited by other subclass and subclass should porvide implementation then there should be atleast one method in the abstract super class which requires implementation.
All i want to know is why java does not force to declare atleast one abstract method in abstract class.
there may be some situations where this restriction can create problem if it is like that then can anybody give some example.
manish

hi,
i didn't get u.
u r trying to say that i have an abstract class with
only static methods then my questions is why wud
declare such a class as 'abstract' class? because a
static method can't be abstract also. Even then if
somebody want to define such a class with only static
methods then compiler should force him to declare
atleast one abstract method which can be implemented
by subclass, because as i said before if sumbody
decide to define a class abstract then he wants that
it should be inhereted but as u r saying a class with
only static methods then it should not be an abstract
class it can be a simple class.there's no functional reason, really... actually, factory-like classes are often defined the way Ceci described
"abstract" only ensures that nobody can ever get an instance of that class (as a matter of fact, what would be the point of getting an instance, if no instance method exists ?)

Similar Messages

  • Why java does not support multiple inheritance ???

    Hai friends ..iam new to java .. i have doubt ..plz help me
    Why java does not support multiple inheritance ???

    The reasons for omitting multiple inheritance from the Java language mostly stem from the "simple, object oriented, and familiar" goal.
    To understand multiple inheritance, the learner needs some level of expertise like virtual derivations etc in c++. Multiple inheritance will allow method duplication, and throws the learner into confusion which method might be called by the compiler in which scenario at run time.
    Even though this answer seems to be funny, this is the actual reason why java omitted multiple inheritance of classes.
    But java support multiple inheritance of interfaces. Multiple interface inheritance allows an object to inherit many different method signatures with the caveat that the inheriting object must implement those inherited methods.

  • Why DDL during SELECT is possible. Or why SELECT does not put a table lock?

    This is a question to people who really knows Oracle internals or/and RDB theory.
    (The question is relocated from another thread for not hijacking on that's original question.)
    Why DDL during SELECT is possible? Or why SELECT does not put TM 2 Row Shared lock on table(s)?
    This not locking causes a possibility while one session is running a long select, another can truncate and even drop table(s) that are being read by the first session.
    I think, humbly assume, that Oracle does not put TM 2 lock on tables, that are being simply SELECTed, by some significant technical reason. But I do not know this reason. If somebody knows please shed a light.
    Also, if you know that this behavior is totally correct from perspective of RDB theory, please explain me.
    I'll try to explain my point.
    It is a matter of data consistency and integrity that is supported in Oracle everywhere except this place.
    a) If one session is reading data from moment T and other session changes data on its way at moment T1, the first session wont read that changed data, it will read the data that was there on moment T.
    This is declared as Read Consistency principle.
    b) If one session is changing data, and another session tries to truncate or drop table - the second session will fail with error ORA-00054: resource busy and acquire with NOWAIT specified.
    This is declared as Data Integrity principle.
    c) But why not to follow the above principles in case when one session reads data and another session tries to truncate or drop table (or do other DDL operations)?
    It is counter-intuitive. Why not to put TM 2 (SS) lock during SELECT execution that would prevent DDLs on this table?
    What I only can assume is that this is only because some technical difficulty or limitation.
    What is this limitation or other reason in favor of which Oracle sacrificed consistency in this case?

    user11181920 wrote:
    Aman,
    There was no need to clarify how DML lock works, I know that.
    Also I know that in Oracle a Select does not lock neither table rows nor table itself.
    The reason I mentioned it because you brought up the word change which is far better suited for DML's than DDL's as the former has a requirement to have its Undo preserved.
    Again, my question was why Select does not protect itself by locking table(s), partitions and indexes?Protect from what? There is nothing wrong with doing a select. What would happen with a select doing a lock on the table before being executed in its entirety (forget DDL and DML altogether for a moment) ? State one good reason that there should be a lock for the select. If it has to, it would be always isn't it?
    The keyword here is concurrency and that's what is the best when the number of locks obtained are lesser at non-required operations. A select doesn't change anything that's why in Oracle, there is no read-level lock.I am not saying about row locks while reading. They are not needed because Undo resolves concurrency.Only in the case of DML where the change is still active and the buffers are dirty. With a DDL, its an implicit commit.
    I am asking why Select does not enqueue one, only one lock per object that participates in the Select?Again, my question back to you is, what good you would get from it? What purpose it would solve?
    It is not very expensive, I suppose. But it would protect from DDLs that can destroy the Select's result set. You have seen in your system and in my demo(and that's what the the question was on the other thread also) that the result remains intact and its not a behavior from now. Its the same since the time I have started learning Oracle. Can you explain that why you think that the result of select statement would be wrong for a drop table? I believe, its been stated repeatedly that if the select has no requirement to look back the table, it would get completed. Only if the select needs to access the table again, it would fail. So even if we consider your explanation, there is no wrong result shown at all. Once the session encounters that the table is dropped for the statement, the execution stops right away. So where is the destroyed result?
    Yes, it is less dangerous when Select does not lock table comparing with what would happen with DMLs in such case (that is why DMLs protect themselves by TM 3), it affects only the Select and its consumer, but still ... I don't understand this Oracle's decision. What is a reasoning behind it?.As I said, to improve concurrency.
    Aman....

  • Java does not work at all upon using the update manager to update to firefox 3.6.10 for Ubuntu 9.0.4

    OS: Ubuntu 9.0.4
    Browser: Firefox 3.6.10
    upon updating to firefox 3.6.10, java does not work at all.
    websites that use java do not work at all anymore, when they worked just fine before the updating thru update manager. e.g. hulu website cannot play any of the shows.
    i can give the folder of bookmarked pages i tried.
    how to do that on here, i've yet to see if possible.
    i can even give saved text from the terminal concerning certain attempts.
    when i updated thru update manager, it gave some weird java plugin that wasn't there before "The IcedTea Web Browser Plugin IcedTea6 Java Web Browser Plugin (execution of applets on webpages)".
    i uninstalled this as instructed by an answer found in one of the pages i saved, cuz it was conflicting w/another java program the updater said i needed. right now, i don't remember for sure what it was. it perhaps was realplayer flash or Java itself. w/all the hours/days of searching i put in, it's difficult if not downright impossible for me to remember all the specifics of what i tried.
    i've searched throughout many webpages (including many searches on mozilla, ubuntu, java, etc) for instruction in fixing the problem.
    oh, and incidentally, on the Java site, when i try the verify test of Java, firefox pops up with that yellow bar right below the slew of tabbed website windows, giving the statement "additional plugins are required to display all the media on this page. (w/link to) install missing plugins ." which is what i do, go thru the requesting plugin installation. it comes up with, guess what, the IcedTea Java Plugin. i click on the 'next' in the "Plugin Finder Service" box that pops up, & all it gives me is "No plugins were installed. IcedTea ...Plugin failed. and the link 'find out more about plugins or manually find missing plugins'". the link takes me to some of the very things/plugins that wouldn't install in the first place. the Java test failure is a LOL funny, as what plugin it is saying is required (IcedTea) is a recommended alternate program to display the very test in the first place.
    i followed the given instructions on those many searched pages, in every case (barring what i may have just plain missed), but to no avail.
    i've even gone to the point of trying to reinstall the previous 3.5.13 firefox version, from mozilla site. even that wouldn't install.
    i've tried installing Java for my sys direct from it's site. nada.
    now it's time for me to post the problem & perhaps someone will come up with some kind of "dummy" way to fix it.
    until then many sites a regularly use are totally useless to me on this fast puter.
    the only way i can get to use such sites, are two choices: 1. use a dinosaur laptop, which is slower than molasses & cannot handle to any streaming stuff, or 2. use an available internet access puter at the library. but useage for ea person per day is limited to only one hour a day. and one can end up waiting for an hour or more ( in the busiest periods) to even get to use one.
    so, is there anyone at all, who knows any for-sure working fix for this problem?
    thanks muchly :^D
    p.s. i can't pay anybody any money for such help, as is required in certain sites (e.g. Java website), cuz i don't have any.
    i can pay in labor tho, if there is someway to find someone who can physically be at this puter w/me, taking me step-by-step
    sorry for the 20-pg essay. i hope it was all clearly understood. if, not, well, clear communication is always what is needed, ask away.

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • PO creation-ME21n-Why SAP does not check company code and Plant relation

    Hi All,
    Does someone know, why SAP does not check Plant and company code relation at the time of PO creation or how can we put validation between plant and company code at the time of PO creation.
    <b>Example:</b> Suppose i have a company 0001 which is assinged to Plant 0001. when i am creating a PO with another company code 0002(Entering at header level-Org, data) and using Plant 0001 at line item level. SAP does not do this validation.
    How can we put this check in place?
    Thanks in advance.
    Deepak

    Hello Deepak,
    There are three types of purchasing
    - Company code specific :You need to assign company code to Pur organization
    - Plant specific : You must assign plant to pur organization
    - Cross company purchasing: No assignment between company code and pur organization.
    In the case 3, the system will not check company code and plant relationship, but it will check plant and pur organization specific.
    The following is the copy of sap help text:
    You can assign a purchasing organization to one company code. This is company-specific purchasing.
    You can assign a purchasing organization to no company code. This purchasing organization can then procure for all plants assigned to it, irrespective of the company code to which the plant belongs.
    Since each plant must be assigned to a company code, the company code can be determined via the plant in each procurement transaction, even if the procuring purchasing organization is not assigned to a company code.
    A purchasing organization must be assigned to one or more plants. This is plant-specific purchasing.
    Now, check your company-code and purchase organization assignment.
    Hope this helps.
    Regards
    Arif Mansuri

  • Why facetime does not working with any carrier in u.s expect att although the iphone is factory unlocked

    why facetime does not working with any carrier in u.s expect att although the iphone is factory unlocked

    Facetime only works via WiFi. Are you trying to set up Facetime with a T-Mobile account?

  • Why condition does not work.

    Hi Pros,
            in my bex query, there is a CKF OT hours, having a value 30.000, when I set a condition for 'OT hours = 30.000', but get no result out. could you please tell why condition does not work.

    HI,
    please check the "Characteristic Assignment" Tab in change condition window.
    In that tab default  selection as "All Characteristic in the drill down independently" change that selection  as "Individual characteristic and Char. combinations"  and choose the particular characteristic. for ex OT hours against employee means select employee alone.
    Regards
    Sureshkumar C

  • Java Does Not Throw Exception When Writing To Read-Only Files

    I have noticed that when I try to write to a read-only file in a window environment, Java does not throw an IOExcpetion, it just dosn't write to the file.
    I am writing an FTP server and here is the code:
         public static long copyStream(InputStream in, OutputStream out)throws IOException
              IOException exception = null;
              long copied = 0;
              try
                   byte buffer[] = new byte[1024];
                   int read;
                   while((read = in.read(buffer)) != -1)
                        out.write(buffer, 0, read);
                        copied += read;
              catch(IOException e)
                   //ensures that the streams are closed.
                   exception = e;
              try
                   in.close();//ensures output stream gets closed, even if there is an
                   //excption here.
              catch(IOException e){exception = e;}
              out.close();//try to close output.
              if(exception != null)
                   //exception is not null, an exception has occured.
                   //rethrow exception.
                   throw exception;
              return copied;//all ok, return bytes copied.
         }Is this a bug in JAVA VM? Is so, how should I report it?

    I have noticed that when I try to write to a read-only file in a window environment,
    Java does not throw an IOExcpetion, it just dosn't write to the file.C:\source\java\Markov>attrib readonly.out
    A R C:\source\java\Markov\readonly.out
    �C:\source\java\Markov>java b
    java.io.FileNotFoundException: readonly.out (Access is denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at b.main(b.java:5)
    import java.io.*;
    public class b {
        public static void main(String[] args) {
         try     {
              OutputStream os = new FileOutputStream ( "readonly.out");
         catch (Exception e) {
              e.printStackTrace();
    }

  • Is it free to send messages in iMessage to another county? if yes why it does not show that these messages from iMessage?

    Is it free to send messages in iMessage to another county? if yes why it does not show that these messages from iMessage?

    if you receive an imessage not on any internet connection you will receive it as a sms (green) and yes it counts toward your texting plan

  • Why java is not 100% oops

    Hi, All
    recently this question was asked in the interview that why java is not 100 % object oriented.....
    plz help me regarding this
    thanx inn advance...
    Ravi

    Many, many reasons. One obvious reason being that Java uses primitives. int, char, double and the rest are not objects.

  • Why RSS does not work with my OS X 10.8.2?

    Why RSS does not work with my OS X 10.8.2? There was no problem before the upgrade to the Mountain Lion.

    By clicking on the RSS icon I'm getting a message:
    "No RSS reader is installed. Safari can't open the feed because Safari can't display RSS feeds"
    In Chrome I get xml file of the RSS site.
    Should I buy something what I didn't need with the Snow Leopard?
    Thanks for your help.
    Message was edited by: PZA22

  • Why Set does not have get() method

    Can some one tell me why set does not have get method?...

    user12203354 wrote:
    ya u are right that designer of this class thought there is no implementation required for get but why he/she thought like this...
    there must be some valid reason for the same.Because a Set's purpose is not to keep things in order; it's to ensure there are no duplicate entries. Set would require extra code to be able to keep track of an order.
    Note that there is a Set implementation that does keep track of insertion order--LinkedHashSet--but it doesn't have a get() method.

  • Hi, I have downloaded itunes on windows 7,when I click on the itunes icon on my desktop nothing happens,it does not open itunes,can anyone help me with why it does not open or know how I can open itunes,thanks.

    Hi, I have downloaded itunes on windows 7,when I click the icon on my desktop nothing happens,does anyone know why itunes does not open?

    If you only changed the name of your ID rather than creating a new ID, just go to Settins>iCloud and tap Delete Account then sign back in with the new name.  (Deleting the account from your phone does not delete it from iCloud.  Your data will be synced back to your phone when you sign back in.)
    If you created a new ID, you'll have to go to Settings>iCloud on your phone and turn all data you are syncing with iCloud (contacts, calendars, etc.) to Off.  When prompted choose to keep the data on your iPhone.  (If you are syncing iWork documents with iCloud, also open your iWork apps and turn off iCloud syncing and choose to keep the documents on your phone.)  After everything is turned off, scroll to the bottom and tap Delete Account.  Next, set up a new iCloud account using your other ID, then turn syncing for your data (contacts, etc.) back to On.  When prompted, choose Merge.  This will upload the data to your new account.
    You won't lose any photos in your camera roll or photo library.  If you have any photos in your photo stream that are over 30 days old that are not in your camera roll or saved on your computer, be sure to save these to the camera roll before deleting the account.  To do so, open the photo stream album on your iPhone in the thumbnail view, tap Edit, tap all the photos you need to save to select them, tap Share, then tap Save to Camera Roll.

  • Why itunes does not sync the calendar?

    why itunes does not sync the calendar?

    Hey ThierryWillame,
    Thanks for the question. Were these songs purchased from the iTunes Store? If so, see the following resource. If not, follow the same steps for the content, based on how you acquired it (delete and re-add).
    Songs in iTunes may not play back completely
    http://support.apple.com/kb/TS4357
    Symptoms
    Occasionally, if a song purchased from the iTunes Store on a Mac or PC was not downloaded completely, the song may not play back fully. The song may abruptly stop during playback, and iTunes may start playing the next song in your library or playlist.
    Resolution
    If iTunes in the Cloud is available in your country, try the following steps to resolve the issue:
    1. Delete the purchased song that is exhibiting the problem from your iTunes library.
    2. Click on the Purchased link in the iTunes Store to view your previously purchased music.
    3. Download your previously purchased song from this list.
    Note: iTunes in the Cloud, which allows you to download previously purchased songs from the iTunes Store, is not available in every country. Learn if iTunes in the Cloud is offered in your country.
    Additional Information:
    iTunes 11 for Mac: Delete songs, playlists, or other items
    http://support.apple.com/kb/PH12159
    Download past purchases
    http://support.apple.com/kb/HT2519
    Thanks,
    Matt M.

  • I have OS X (10.6.8) , I have downloaded Apple Java 6 update 13, pogo chess does not recognize my Java, also Java does not appear in system preferences

    I have OS X (10.6.8) , I have downloaded Apple Java 6 update 13, pogo chess does not recognize my Java, also Java does not appear in system preferences.
    How do I get Java to work.

    I just got off phone with AppleCare about same issue. Here is how to fix:
    How to reinstall Java for 10.6.8:
    - Go to:  /System/Library/Java/Support/CoreDeploy.bundle/Contents
    -  Move: javaAppletPlugin.plugin to the trash
    -  Run update   ---   Found at: http://support.apple.com/kb/DL1573
    -  Reset safari
    -  Empty cache

Maybe you are looking for

  • My External hard drive keeps ejecting randomly in Snow Leopard. How do I stop this, and prevent it from happening?

    I'm currently running a clean install of Snow Leopard version 10.6.8, and I have done nothing but attempt to mount my external hard drive, which is a Fantom 2 TB Greendrive connected via eSATA through an ExpressCard. It performed flawlessly in Leopar

  • How to connect Apple TV with AT&T Uverse

    Need help pls.  Not sure how to connect Apple TV2 to AT&T Uverse.  I know I need to connect one cable to my wireless router, and another cable from the HDMI port to my TV.  That part is clear.  But my Uverse router is in an upstairs closet, and my TV

  • Transfer iphoto library to external hard disk

    My iPhoto library of 320 GB has is filling the internal disk on my MacBook Pro. I copied the library intact to an external hard disk, checked to make sure the external library works with iPhoto and everything was ok, then emptied the trash. This did

  • Default Expense Type in Travel Expense

    Dear All I have a requirement. I have created 4 Expense Types AIR HOTEL TAXI TRAIN. Now my requirement is everytime employee tries to create an Expense Report in correspondence to the Travel Request, the expense type HOTEL gets defaulted in the lower

  • Corporate Database Crash

    If I put the corporate database on the network (the most logical place), and I am not connected to the network (very common with my notebook or if the network goes down for any reason), then Multisim and Ultiboard can't find the database.. of course.