Why cant we put anything outside classes ?

i couldnt think about any other title,as i am getting more and more confused.
this is what i know :
an object is "something" which has got some functionality && exists in memory (thats why real-world).
why cant we create objects of "only" methods ?
to be exact,i cant understand why java needs to put everything in the class?
eg.
public static void main(String args[])
int i;
i=i+5;
this method should be able to form an object, it has got both data members, and it can call another function to modify the data.
why do we NECESSARILY need to put this in a class ?

paul.miner wrote:
dpux wrote:
i know its a design specification...but what advantage does it give ??
josAH gave a valid point, but are there some others ?Old (current?) PHP is an example of what happens when you have a global namespace. Thousands upon thousands of functions with ugly names or stupid prefixes/suffixes ("real", "2", etc.). Static methods in a non-instantiable class are basically like creating namespaces for global methods.
It's also much easier to find functions that belong together grouped in a class.True, but if "global functions" had been allowed in Java, I bet you a doughnut they would have used package names as a name space, in exactly the same way this is done with classes and interfaces.
But again, idle speculation like this is a waste of time...

Similar Messages

  • Why cant i put a song as my ringtone

    why cant i put a regular song as my ringtone on my iphone 5?

    You can do it, see here: https://discussions.apple.com/message/22037410#22037410

  • TS4293 why cant i put some clips into imovie ?

    why cant i put some clips into imovie ?

    What exactly do you mean? Are you taking clips out of an event and trying to put them into a project?

  • Why did my sound/audi​o cease working? why cant i hear anything?

    why did my sound/audio cease working? why cant i hear anything? i own a HP Pavillion g6 notebook pc {Removed for privacy}

    What is the exact model of the notebook?
    omaji,
    Did this happen after a BIOS update as well?
    Is the notebook using the original operating system the notebook came with?
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Why cant i view anything on the page?

    Im trying to view a web page but all i see is a loading bar that when finish loading, nothing comes up. My flash player is up to date and my company help desk says it works on their mac computers. Why cant my computer view the same thing?

    Please read
    http://forums.adobe.com/thread/1195540

  • Why cant i do anything with my game center

    why cant i get any games with my game center?

    Hello there,
    Are you saying you want to manually edit your iPod's contents within iTunes? If so, you will have to enable the "Manually manage music and videos" option from under your iPod's Summary tab in iTunes. Otherwise, everything will appear grayed out.
    [Managing content manually on iPod and iPhone|http://support.apple.com/kb/HT1535]
    B-rock

  • Why cant i put videos on my nano

    why cant we?
    is there a way? like a hack?

    Wow... you wait a whole five minutes before reposting? A little impatient, no?
    No... you cannot play video on a nano.
    Cheers!
    -Bryan

  • Why cant i purchase anything on Itunes

    I was just wondering why i cannot purchase anything on Itunes

    You have supplied NO details... makes it extremely difficult to assist... Therefore...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Why cant adobe put out anything without a bug?

    I have had problems with anything adobe since I first owned a computer 15 yrs ago!  I'm not saying i'm a computer expert but after 15 yrs I know just maybe a little! That said I'm wondering if these people who work at adobe are required to get stoned before coming to work! Something is going on there that seems to prevent the big brain from getting in the way of the little brain. In case you have never heard this comparison, if we can send a man to the moon then why in god's name cant adobe make a problem free program? problems downloading , problems freezing( ok well they did fix that problem!), problems not uninstalling previous versions( why th hell do i have to worry about this?), problems with flash player allowing me to play online games and causing my browser to freeze(I guess they havent fixed this one yet!), problems, problems problems! If I had a dollar for every hour I've spent trying to fix adobe problems on my computer I could retire on that instead of my union movie pension! All's I can say is there must be some good **** going around over there at adobe because their brains are made out of the same stuff as the name of the place where they work.

    I don't know; I never had the slightest problem ever since I started using Adobe products some 17 years ago.

  • Why cant i put movies on my ipod?

    i cant put a movie on my ipod touch and i dont know why because i still have heaps of space

    See:
    iTunes: May be unable to transfer videos to iPhone, iPad, or iPod
    iTunes: Frequently asked questions about viewing and syncing videos

  • Why cant I post anything or search in facebook when using Firefox but I can with internet explorer?

    When I am using firefox I can not post on anyone's wall or search for friends. When I switch to internet explorer I can. This has been happening for over a week now. I cant even access the facebook help center because it wont let me click on anything. Also it does not let me like anyones comments or pages. Please help me I hate internet explorer I like Firefox.

    There are some compatibility issues between the latest Flash player and some Firefox add-ons or settings. Usually this manifests itself in problems with video, but games might also be affected. Could you see whether anything in this article helps: [[Flash 11.3 doesn't load video in Firefox]].

  • Why cant i put them on my phone?

    i purchased several apps but i cant put them on my iphone

    people downloaded it off the internet and installed it before apple released it. hackers got the 2.0 update months before it was released. im sitting at my desk waiting for the update to come out, im kinda gettin a little frustrated.

  • Why cant i put music on my phone

    cant put music on my phone from itunes on my computer

    Do you have iTunes Match switched on, or are you trying to add music manually ?

  • Why cant I put video on my ipod touch 2g iOS 4.2.1?

    I know there are a ton of discussions involving this but I need specifics in regards to the specs. So what I am going to do is post EXACTLY what I converted the file to, and can someone please tell me where I went wrong?
    Also, do I need some sort of media player app to play these videos? I tried searching for hours the other night for an app like this (thats free) compatible with 4.2.1 to no avail. It is extremely frustrating.
    Also I am going to post this seperatly i think but I downloaded and app called idownloader lite. I wanted to be able to go on the internet and download a video to watch for later use offline. It says to go thr ough their browser find a video (not from youtube) and copy and paste the url to do this. but it NEVER works! Does anyone know of a website that will work with this?
    The problem is my older operating system, I cant find any good apps for stuff (they need to be free unfortunatley) I wanted to get a youtube app that I could d/l video for use offline but i cant find one compatible.
    Well here is the info from the video i converted, did i do this right?
    eneral
    Complete name                            : C:\Documents and Settings\Tricia\My Documents\Downloads\New Folder\WildRussia1.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 306 MiB
    Duration                                 : 47mn 7s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 907 Kbps
    Encoded date                             : UTC 2013-07-22 23:42:11
    Tagged date                              : UTC 2013-07-23 00:26:12
    Writing application                      : HandBrake 0.9.9 2013052900
    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : [email protected]
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 2 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 47mn 7s
    Duration_LastFrame                       : -7ms
    Bit rate mode                            : Variable
    Bit rate                                 : 744 Kbps
    Width                                    : 640 pixels
    Height                                   : 400 pixels
    Display aspect ratio                     : 16:10
    Frame rate mode                          : Constant
    Frame rate                               : 25.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.116
    Stream size                              : 251 MiB (82%)
    Writing library                          : x264 core 130 r2273 b3065e6
    Encoding settings                        : cabac=0 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=768 / vbv_bufsize=2000 / crf_max=0.0 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
    Encoded date                             : UTC 2013-07-22 23:42:11
    Tagged date                              : UTC 2013-07-23 00:26:12
    Color primaries                          : BT.601 PAL
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.601
    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 47mn 7s
    Bit rate mode                            : Variable
    Bit rate                                 : 160 Kbps
    Maximum bit rate                         : 196 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Compression mode                         : Lossy
    Stream size                              : 53.9 MiB (18%)
    Encoded date                             : UTC 2013-07-22 23:42:11
    Tagged date                              : UTC 2013-07-23 00:26:12
    Thank you for all your help, I know this is alot of work!

    You may be able to get the las compatible version by:
    Starting when iOS 7 was released, Apple now allows downloading the last compatible version of some apps (iOS 4.2.1 and later only)
    App Store: Downloading Older Versions of Apps on iOS - Apple Club
    App Store: Install the latest compatible version of an app
    You first have to download the non-compatible version on your computer. Then when you try to purchase the version on your iPod you will be offered a compatible version if one exists.

  • Why cant i put a advert blocker on my computer

    mozilla firefox will not let me put a advert block on to my system i will change browers on tuesday

    Do a malware check with several malware scanning programs on the Windows computer.
    Please scan with all programs because each program detects different malware.
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender:<br>http://windows.microsoft.com/en-us/windows/using-defender
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    *https://support.mozilla.org/kb/troubleshoot-firefox-issues-caused-malware

Maybe you are looking for

  • Field Bus. Area is a required field for G/L account 9000 12053040

    Hi SAP, When i do good receive via Txn MIGO, i received error message "Field Bus. Area is a required field for G/L account 9000 12053040". Is there any setting i have to do in config to solve this problem? The details of the error is like below: Mess

  • Error in simple(File-XI-File)scenario

    Hi, Using this blog i was doing simple(File-XI-File)scenario. /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1 But i am getting the error Runtime error com.sap.aii.utilxi.mis

  • OWB 11.2  :using mysql in a mapping

    Hello all, I am new to OWB (but not to oracle ) and I am currently trying to use a mysql database as source for some staging tables. I installed and configured the jdbc drivers in order to be able to connect to the mysql database, so far so good. the

  • Need ideas for best audio setup on Q180

    Hello all.  I've got a Q180 and very nice it is too, apart from one major ommision; there is no audio input/output on the rear panel, only on the front.  I want a setup where I can have speakers plugged in to the rear somehow, but also be able to swi

  • Error-19 while trying to upgrade to v.7.4.1

    In Airport Utility, when trying to upgrade to the 7.4.1 firmware (from 7.3.2), I keep getting an Error-19 message: *An error occurred while reading the configuration*. Make sure your Apple wireless device is plugged in and in range of your computer o