What is the benefit of static in a method/function

hello,
can u explain the benefit of static in a function?
and why i cannot called a function in a static method..example :
class jalaninFungsi{
     public static void main(String args[])
          tesfungsi();
     public  void tesfungsi()
          System.out.println("ini tesfungsi");
}its produce error : non-static method tesfungsi() cannot be referenced from static context
thanks.

A class is an object.
So for example:
class STUDENT
public String getStudentName()
return name;
public int getStudentGPA()
return GPA;
In this case, to be able to call the function getStudentName() and getStudentGPA() you will actually need a STUDENT object.
That means you must have declared e.g. STUDENT A; (in the main method for example), then to call those two functions above you'll need to write A.getStudentName(); and A.getStudentGPA();
HOWEVER if you have static method, you don't need to create an object of that class type. You can just simply call the class name and then use the dot operator and call the function. e.g.:
class STUDENT
public static String getStudentName()
return name;
public static int getStudentGPA()
return GPA;
Notice that these are static methods, so to access these methods you just need to write STUDENT.getStudentName(); or STUDENT.getStudentGPA();
Again, notice that here I don't use A . but instead I used the class name (STUDENT.)
However, this is not logically correct in this (my) particular case to make those two methods static. You'll need to read more by yourself about the usage of static method. I am just trying to explain it to you why there is such thing called static methods in java.
- o.z.

Similar Messages

  • What is the benefit of Using Data Adaptor

    Hello
    I wonder that What is the benefit of Using Data Adaptor ? I don't know TopLink Technology , inorder to using Data Adaptor I should know toplink but what is the advatages of using BPEL database adaptors in conditions thet I can make webservices by making plsql web services or exposing ADF application modules more easier?
    I think that if I use Data Adaptor (based of Toplink) I can use JTA feature for transaction managment , am I thinking Correct?
    for example I can invoke to webservice A and the B in BPEL process with two DB adaptores (by global transaction ) such that if A failes the process automatically roles back the B transaction without need that I manauly compensate the undo process
    please help me ?

    Thank you for your very useful comments about DB adapter
    I tried again and I have Successfully deploy and test my DB adapter with using # for parameter.
    But I have another question : We have ADF Application that using ADF bc for user data entry supporting in use case scenario , but we want to call web services (eg BPEL) in save operation instead of ADF application modules Normal commit !
    If we want using Data adapter for persist the Data that user entered by UI , we must write a lot of Insert or Update statements in DB adapter because of lot of database entities.
    How can we shorten this production scenario in our Project?

  • What is the benefit of configuring the XSS Homepage Framework for ESS

    What is the benefit of configuring the XSS Homepage Framework for ESS?
    Over using standard iViews.

    It means you can disable (or enable) the exact functionality your customer needs rather than sticking with the default implementation.
    Most customes do not use everything available from ESS or MSS.  Switching it off (making it unavailable) is WAY better than leaving potentially unconfigured content to be accessed by users.  SAP generally do not handle the error cases and you will get lots of nasty stack traces .....
    Haydn

  • What is the benefit of using J2EE for webservices?

    (I posted this on google news group, but no one answer, sorry for the cross post)
    This maybe obvious to some of you, but after I went over the
    webservices tutorial from Sun, about XML RPC and JAXM, I don't know
    what is the benefit of using webservices within J2EE container.
    Please tell me about it.
    My assumption is that RPC and JAXM both enables the communication, but
    the managing of session, persistent, thread pool, connection pool,
    database, etc, are all handled by the container. Well, I still hope
    my assumption is true. However, from what I read, the tutorial does
    not even mention the word beans. So, how to get a beans to talk the
    JAXM language so that I can get all of the above features? Or am I totally off track here? if an enterprise bean is not needed, then how to get all the above benefits that the J2EE offers?
    By the way, does Sun's RPC and JAXM has things such as quality of
    service (such as request time out). They mention guarantee delivery,
    but if a reply to my query come 5 minutes later versus instantly, then
    I probably lost a customer already. RPC also has big limitation, Corba has asynchronous request, but Sun's RPC does not.
    Thank you in advance for all comments and help.

    Basic communication aside, J2EE is mostly a synchronous run-time environment. When asynchrony is introduced, a whole new set of infrastructure requirements is needed to support QoS and commercial-quality implementations. In other words, it's not just about API anymore, it's about reliable communication, exception handling, time outs, etc. You may want to look at this Q&A to see some of the benefits provided by J2EE as underlying run-time for orchestration:
    http://searchwebservices.techtarget.com/ateQuestionNResponse/0,289625,sid26_cid511195_tax292928,00.html
    Doron\
    Download Collaxa 2.0
    http://www.collaxa.com

  • What is the benefit of using POE than AC Power?

    Hi,
    We are currently research on what is the benefit of POE over AC Power for wireless AP.
    Most of AP we are using is 1252 and 1142.
    Anyone can tell the different?

    Hi,
    Try to plan to install both scenarios and you'll know the difference yourself.
    Besides what Leo mentioned, imagine that you are going to use AC power and for every AP you are going to install a power outlet close to the AP to power it up.
    Now, if later you decided to change the AP location you need to install a new power outlet in the new place. The old power outlet is usually left wihtout use. extra cabling, extra waste of resources (materials, man power...etc).
    HTH
    Amjad
    Rating useful replies is more useful than saying "Thank you"

  • What is the benefit of using Firefox over Safari?

    I am a long time PC user who just ran through her 5th laptop, 1 toshiba, 2 panasonics, and 2 dells. Finally decided to buy my first Apple product, MacBook Pro. Purchased yesterday and trying to learn the new system. My question is, what is 'wrong' with Safari? In other words, what is the benefit of downloading FireFox for the Mac? thanks!

    I DID use Firefox on my PC.....very superior to Explorer. But since I have never used an Apple product before purchasing this MacBookPro yesterday, I have no idea what the Apple (Safari) browser is like. I don't have to bother getting used to Safari if the Firefox for Mac is a better product.

  • What is the benefit of using clipping paths for a knock out?

    I found a posting saying they need someone to knock out the background of a lot of images using clipping paths. My question is, WHY use a clipping path? I know the rule of not using a selection tool such as the Magic Wand and then turning it into a clipping path and I know why that is. But if all is needed is for the background to be knocked out, why can't we just use the selection tool in the first place and just knock out the background from there? What is the benefit of that clipping mask?

    Usually the term Clipping Path refers to turning a path into a clipping path (in the paths panel) for use in older programs such as PageMaker that don't support transparency.
    For example if one wanted to import a file into PageMaker and only have a certain part of the document visible, one would make a path (or selection) around the object
    and turn the path (or selection) into a clipping path. Sorta the same results you see in photoshop using a layer mask or vector mask.
    Also clipping paths are used in certain printing workflows.
    Without seeing the posting it's hard to say what they meant and in photoshop 6 vector masks were labeled as Layer Clipping Paths not to be confused with real clipping paths.
    Old versions of photoshop also used the term Group With Previous to denote Create Clipping Mask.
    photoshop 6:
    Photoshop cs6:
    Anyway clipping masks and clipping paths are two different things in photoshop.
    layer masks, vector masks and clipping masks:
    http://helpx.adobe.com/content/help/en/photoshop/using/masking-layers.html
    an example of creating a clipping path:
    http://www.clippingpathspecialist.com/tutorials.html

  • What is the benefit of "Enable Final Cut Studio color compatibility" in QT?

    Hi(Bonjour)!
    What is the benefit of "Enabling Final Cut Studio " in Quicktime player?
    I'm used to calibrate my monitor to a less bright gamma, suitale for monitoring video content.
    So does the +color compatibility option+ can give me more precision when I color correct my movies?
    Michel Boissonneault

    It does the same thing. The only difference is that the pref is active only when the QT player is active. So the gamma is not effected in other parts of the system.

  • Can someone explain what is the benefit of the Find My iPhone feature?

    I've upgraded my iPhone 4 to the next OS and it comes with the Find My iPhone feature. It took me a while to set it up, but it's OK, especially when it's free for those lucky iPhone 4 users. But now the question I have, what is the benefit of this feature? (Well besides spying on your girlfriend or wife) I mean, if someone steals my iPhone all they need to do is to delete the mobile me account, or better, turn this feature off. It's not even password protected. Maybe I'm just not getting something???

    Obviously once my phone is lost I'm going to change my password on my emails right away and call AT&T to freeze my account.
    You are assuming that you will know your phone is lost or stolen the instant it happens. Don't be so naive. Unless your iPhone is glued to your forehead it could be hours or maybe the next morning before you realize it's gone.
    This is not where you should store that stuff.
    Who are you to say what people should or shouldn't store on their smartphone? Above you admit you're not even aware of Apps that can store data (credit cards for instance) as securely as the banks and websites you use them at.
    Apple's approach to encryption is mostly based on "security by obscurity", or, "our operating systems don't get hacked often... and thus we're safe." But this is VERY wrong!
    Actually, you're wrong and clearly know very little about security PERIOD. Anyone who doesn't use even the basic security built-in to any device simply because it is an "inconvenience" almost deserves to have their identity stolen.
    Educate yourself a little on some of Apple's iPhone security measures by reading: http://images.apple.com/iphone/business/docs/iPhone_Security.pdf
    No device is immune to the most determined hackers but to say Apple's approach is mostly "security by obscurity" just highlights how little you know about such things.

  • What r the benefit of using field symbols

    hi all
    what is the benefit of using field symbols and when is  recommended to use it?
    regards

    It Just assign the values directly to fieldsymbol and no need to used append.
    It increases the performance of the program.
    also check this
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm
    Reward points if useful
    Regards,
    Vimal

  • HT201341 what is X11 all about? what is the benefit of having X11?

    what is X11 all about and what is the benefit of having X11?

    Welcome to Apple Support Communities
    If you ask this, you will not probably need it. X11 is a version of the popular X Window System, used by most UNIX operating systems (including OS X). Since OS X Lion (I think), it is no longer included, and you only need it to run some specific applications.

  • What is the benefit of having the macbook register to apple?

    just wondering what is the benefit of having the macbook register to apple
    will it prevent someone stealing the macbook and we can track where this macbook is?
    or just for warranty purposes?
    by the way any suggestions for locking or something to prevent someone steal the macbook?

    even though i register with apple, if someone stole my macbook, they can still use it without any problems?
    Yes, they can. Registering with Apple doesn't have any effect on the computer itself at all.
    like if they go repair the macbook, will apple know that this macbook was stolen?
    Generally no. Apple has no formal tracking ability, and as a former Apple employee once posted, they have no way of knowing just from some user's report that an item is indeed stolen and so cannot make assumptions; it wouldn't be the first time someone made a false report. If an authorized law enforcement agency were to contact Apple, Apple might be in a position to do something, but it's rare that police have the resources to take those kinds of actions unless it's a large theft, as with someone robbing a store.
    Regards.

  • What is the benefit of Transportation planning point ?

    Hi Gurus,
    Need help , i know that Tppt is org. unit , but what is the benefit of Tppt for transportation module?
    and what function tppt have ?
    Rudy.

    Hi,
    functions of Transport planning point
    1.carry out transportation planning and shipment completion
    2.shipment cost calculation and transfer to accounting department
    3.all document related to shipment are processed in TPP
    regards

  • What is the benefit of up grading from ATI Radeon 1900 to ATI Radeon 4870?

    What is the benefit of up grading from ATI Radeon 1900 to ATI Radeon 4870?. Will the average user that does not use video game see the difference? What programs would I see the benefit in?
    Thanks!

    Installing 3 NVIDIA GeForce GT 120 will allow you to use up to six monitors. Installing the Radeon 4870 will give you some benefits in certain video/graphic editing programs. If all you do is email, web surfing and non-graphic intensive stuff than the NVIDIA GeForce GT 120 is adequate.

  • What's the benefit of using Essbase?

    What's the benefit of using Essbase instead of the OLAP option built in Oracle? Performance reason?
    But Essbase is so huge and we just use a bit of its functionalities...

    I hope you're comparing Essbase & Oracle OLAP.
    Go through the Vlamis' presentation in 2008 at: http://www.vlamis.com/Papers/collab2008-presentation2.pdf
    Both were compared under various heads like- Logical Structure, Data Storage, Dimensional Model, Loading Data, Aggregation, Allocation, Calculations, Scalability, Writeback Handling, Security, Administration, Access to Data etc.,

Maybe you are looking for

  • Help! Audio is working but video is not!

    Hi. I've recently started using iChat AV 3.1.8 (v445) and I'm on a white macbook - Mac OS X version 10.4.11 processor: 2 GHz intel Core 2 duo Memory: 1 GB 667 MHz DDR2 SDRAM My friend and I have been trying to video chat on ichat we are both using ma

  • Performance Problems:  Power Mac 867 MHZ G4

    I have a Power Mac 867 MHZ G4 with 1.12GB RAM. Going from Panther to Leopard REALLY HURTS performance. Programs launch slower and even MS Word typing characters echoes slower. Is this something that more memory would cure? THX.

  • SA User Id ?(New to this technology)

    Hi guys, OMWbench Capture Wizard is giving me user ID SA. MY q is do I have to created this ID with password and privilege inside SQL Server data source before I used it here? Is there any password coming with this ID (SA)? 2. Does the OMWbench captu

  • Class as an attribute name in JSP tag file

    I just ran into an issue where I was writing a custom tag to generate a specific set of HTML elements, and wanted to be able to use CSS the same way I had before refactoring it into a tag. So, I included 'class' as an attribute in the custom tag file

  • [SOLVED] Syslinux.cfg changes not taking effect

    When I first switched from grub to syslinux, I discovered that my system won't boot properly without a nomodeset command in the boot line (actually I knew that; it was also in grub but I installed that 5 years ago and long since forgot).  It worked g