Difference between main and other threads

There are a lot many tings you cannot do n the main thread( the thread running the main Method) and other Threads how exactly do they differ?

Why doesn't it allow running the static methods from
main like dumpStack( )....You can run static methods from main. Do you mean the main thread or the main method?
You can't call non-static methods directly from the main method, but that's just because it's static. You can't call non-static methods from any static method, without an instance on which to call them. Nothing special about main in that respect.

Similar Messages

  • What's the difference between Main ( ) and Main { } ?

    I have been searching around, but still no luck finding the difference between Main ( ) and Main { }. I found that java uses ( ), and javafx uses { }. But in javafx I can still use ( ). Is there different meaning?
    Thanks.

    I am not sure what you mean, but I will take a guess.
    Remember just one thing:
    1) You can easily instantiate a class to an object in JAVAFX using a JAVA or JAVAFX class, but in JAVA you can only instantiate JAVA objects.
    (Not completely true. If you really want a headache then you can instantiate JAVAFX classes in JAVA, but it is not easy.)
    Let me give you the following class that contains some variable:
    JAVA
    class MainJava {
         int     blaInt;
         long    blaLong;
         String  someString;
         String  anotherString = "(First Bicycle) Look mom no Hands... Look Mom no teeth.";
         public MainJava() {
             // Before this contructor runs all variables will first be initializes to their default values or whatever you put in them above
             // Construct things :)
         } // END CONSTRUCTOR for MainJava
    } // END CLASS MainJavaJAVAFX
    class MainJavaFx {
         var     blaInt : Integer;
         var     blaLong : java.lang.Long; // The most usefull number made difficult in JAVAFX :(
         var     someString : String;
         var     anotherString = "(First Bicycle) Look mom no Hands... Look Mom no teeth."; // Thats nice. No need for a type :) Heaven ... I'm in Heaven
         init {
             // Before this contructor runs all variables will first be initializes to their default values or whatever you put in them above
             // Construct things :)
         } // END CONSTRUCTOR for MainJava
    } // END CLASS MainJavaFxThese 2 classes are affectively the same.
    One written in Java and one in JAVAFX.
    You already seem to know JAVA so I am going to talk in JAVAFX code from now on.
    1) To instantiate a JAVA class in JAVAFX is the same as in JAVA.
      var myNewObj = new MainJava();2) To instantiate a JAVAFX class in JAVAFX you do the following.
      var myNewObj = MainJavaFx{}; // Weeeee .. easy hey :) I likeThink of init{} as the contractor of the class in JAVAFX, because there is no more constructors in JAVAFX like in JAVA.
    Also in JAVA you can pass parameters to the class constructor, whereas in JAVAFX that is not possible anymore.
    So sad, but what JAVAFX taketh away ... JAVAFX giveth so muchth moreth ... th...
    Now witness the power of ... JAVAFX ...
    In JAVAFX you can instantiate any "var" variables when you create the object from the class.
    Therefore you do not need to pass parameters to the init constructor, most of the time you do not even need init.
    So lets say you want to give the class variable other default values in the JAVAFX class then you can do it like this:
      var myNewObj = MainJavaFx{ 
                                                   blaLong : java.lang.System.currentTimeMillis()
                                                   blaInt : 1234
                                                   someString : "Going to the Hospital I see"
                                                   anotherString : "Thorry Mom."
                                          }; // Weeeee .. easy hey :) I likeNow isn't that nice.
    Keep in mind that the init{} and postinit{} code blocks will only run if they exist after the object is created and therefore the variables will already be changed to the values you have given them when you instantiated the class.
    Cool hey :)
    You can not do that to a JAVA object, but then again if you need to change the class variables of a JAVA object then just create a constructor that takes paramaters and update the class variables in the constructor.

  • What's the difference between CoBuilder and other developmen​t tools?

    Is there any more excellent features about CoBuilder?
    or What's the difference between CoBuilder and other development tools?
    I just want to know more about it.
    Thanks!

    One more thing, if you do not have the hard drive icon on the desktop you can get it there by:
    click on the desktop so the menu bar says Finder next to the apple logo, click Finder, then Preferences, General, Show These Items on desktop and check the hard disks:
    That makes life a lot easier when you want to find out information.
    Ralph

  • What are the differences between Oracle and other NoSQL database

    Hi all,
    I would like to know what the differences between Oracle and other NoSQL database are.
    When and why should we use Oracle?
    Is Oracle NoSQL database link with Big Data Appliance?
    Can we use map-reduce on a single personal computer? How should we install Oracle NoSQL database to use map reduce on a single personal computer?
    Do we also have eventual consistency with Oracle NoSQL database? Can we lose data if master node fails?
    Are transactions ACID with Oracle NoSQL database? How can we prove it?
    Thanks.

    893771 wrote:
    Hi all,
    I would like to know what the differences between Oracle and other NoSQL database are.
    When and why should we use Oracle?I suggest that you start here:
    http://www.oracle.com/technetwork/database/nosqldb/overview/index.html
    Is Oracle NoSQL database link with Big Data Appliance?Yes, Oracle NoSQL Database will be a component of the Big Data Appliance.
    Can we use map-reduce on a single personal computer? How should we install Oracle NoSQL database to use map reduce on a single personal computer?Yes, I believe you can run M/R on a single computer. Consult the various pieces of documentation available on the web. You may run Oracle NoSQL Database on the same computer that you are running M/R on, but it is likely that they will compete for CPU and IO resources and therefore performance may suffer.
    Do we also have eventual consistency with Oracle NoSQL database? Yes.
    Can we lose data if master node fails?If you run Oracle NoSQL Database with the default (recommended) durability settings, then if the master fails, a new one will be elected and data is not lost.
    Are transactions ACID with Oracle NoSQL database? How can we prove it?Yes, each operation is executed in an ACID transaction. The API has the concept of "multi" operations which allow the caller to perform multiple operations on sets of records with the same major key, but different minor keys. Those operations are also performed within a transaction.
    Charles Lamb

  • Difference between itunes and others like vudu for downloading bought movies

    when buying & downloading movies, what the difference between Itunes and others like VUDU, Netflix, etc

    Vudu and Netflix are streaming services.  Netflix is a subscription service, Vudu is a rental service.
    Itunes sells and rents content that you download to your computer.

  • Transfering control between main and a thread

    Hi,
    How to transfer control from a thread which has been initiated from main, back to main.I have a variable and if the value of the var is true the control should go back to main after performing a task the value of the var is set false and the control should be passed to the thread.
    Please help me with a sample code.

    hullo
    control back and forth between threads????
    i'm sorry i dont know if i'm getting you right.
    unlike in method calls where the control returns back to calling method, threads are designed to execute independently.
    and if you spawn a thread from main method both main and spawned thread would be executing simultaneously and only JVM simulates the operating system's control switching between the created threads.
    we can however sleep, yield or wait on a resource.
    you can do all that you were mentioning in the spwaned thread. by writing it in the run method.
    skeleton code:
    public class Exp {
    public boolean choice;
    public exp(boolean choice) {
    this.choice = choice;
    SpawnedThread st = new SpawnedThread(choice);
    if(choice == true) {
    //perform whatever
    notify();
    public static void main(String ar[]) {
    new Exp(choice);
    class SpawnedThread extends Thread {
    boolean choice;
    public SpawnedThread (boolean choice) {
    this.choice = choice;
    start();
    public void run() {
    if(choice == true) {
    wait();
    // resume the task

  • Color differences between LR and other editing/viewing programs

    Thanks for the great info here. I'm hoping someone might know the answer to a question that is driving me over the edge. I SURE would appreciate sincerely any help. My problem is this:
    If I load a picture into Word, Firefox, IE, or other picture editing programs, they all look very much the same. BUT, when I load the same pic into Lightroom Beta or now Lightroom 1.0, it is SIGNIFICANTLY warmer by at least +10 or so.
    This is a real problem in that if I export a pic, say, to Outlook for emailing, it looks very blue in comparison to when in LR. So, I have to go back into LR and edit the pic to a look that looks not right in LR in order for the exported pic to look right in any other viewing program.
    I have calibrated my monitor, but if you note what I said above, it can't be due to calibration -- i.e., that pics look the same in all programs except LR. (I'm using Windows XP). Many thanks for any help.

    See nearby Thread: http://www.adobeforums.com/cgi-bin/webx/.3bc33e02/9
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core, Pentax *ist D
    http://donricklin.blogspot.com/

  • CS5 - Color difference between Photoshop and other programs

    I'm running CS5.5 student edition on a brand new Asus Q500A laptop running Windows 8. i7 processor and a UMA graphics card.
    I do not have calibration software; I'm using Calibrize for the moment and colors appear fairly true when browsing after calibration.
    My problem is that overall colors in Photoshop appear more saturated than those in regular browser windows, particularly reds. I set up my computer to run the Win8 photos app and my desktop with Photoshop simultaneously and the color difference was immediately noticeable. I did a quick screen grab to show the difference; the inset photo is the one viewed in Win8's photos app, and the background is the exact same photo open in Photoshop.
    This is the second install of this program. I originally installed it on a Dell Inspiron with a DuoCore processor (way out of spec, I know - that's why I upgraded!) and I seem to remember having this issue then, too. I found a way to correct it, but I don't remember how I fixed it and Photoshop is no longer on that machine so I can't look over my settings.
    I have not changed the color profile in Photoshop. When installed it chose North America General Purpose 2 as default and I've left it there. I experimented with the other color profiles and while the color tone in Photoshop changes, there is still a difference when the image is viewed in another program.
    Any help is much appreciated - I can't trust the program to handle color properly right now and until I can, I'm dead in the water.

    I'm sorry, but I have to disagree. When I view the image on another computer or my iPhone, the image views properly. It's my photography, from a tree in my back yard. I know how the image is supposed to look, and right now it doesn't look right in Photoshop.
    On my previous machine, I am almost positive that it was saving as sRGB by default as well. I don't remember what color profile I was working in, but I know that I did not have a color profile/space error pop up on opening new images, nor do I have that problem on other images saved on that machine that I'm opening on the laptop.

  • What is the differences between object and other variables?

    For example:
    Object[ ] mm=new Object[10];
    int[ ] mm=new int[10];
    what are their differences??? How to use them correctly??
    Thank you very much!!

    Would you please explain deep about it ?????
    the most important is when to use object and when to
    use other primitive data type
    (int,float,long,double)??
    Thank you very much!!!Each type, whether primitive or object, models some idea or thing or abstraction.
    Use primtives when you just need raw values with no behavior. If you need an integer number, you'll generally use int, sometimes long, rarely short.
    Use objects when you need the concepts they model--String when you want a string of text, Date when you want to represent a date, whatever class you create (Person, Student, Car, Whatever) when you need to use or manipulate the concepts they model.
    Use the object wrappers for the primitives--Integer, Double, etc.--when you want to represent the number but you're using it in a context where objects are required--e.g. when adding them to a collection.

  • Whats the difference between moto and htc/lg/samsung

    10 points for the first person to respond with the correct answer. what is the major difference between motorola and other android makers on verizon

    Hey,
    As the owner of a Motorola Droid 3, I can speak from experience.  One of the main differences between Motorola Android devices and others is the user interface.  For example, the HTC android devices use the Sense interface, which allow the user to make custom changes on their device.  The Motorola Droid 3, as well as other Motorola devices, uses the standard Google interface, which allows for the user to sync their device easily with their Google account for items such as email, calendar, books, and my favorite, Google Play.  I have a lot of music I have bought and the Google cloud service is really neat.  Motorola devices also come preloaded with Motocast software, which allows the user to do many things, such as stream music from your home computer to your device.  I have not yet used the Motocast software, but it would be really handy, especially if you have a lot of files on your home or work PC and need access to the files from your device.
    I hope this answers some of your questions.
    Doc

  • Color problems between Lr5 and other software

    I can not see where to make adjustments to get the same tones between Lr and my other software: Photoshop, Irfanview, Windows Viewer ...
    My test conditions:
    My monitor is calibrated
    ... - Export Lr Jpeg quality 85% and also tests 16bit TIFF (sRGB, Adobe rgb and prophoto)
    ... - When exporting, I checked the "add to catalog" to view the same image in Lr.
    Conclusion: Other software gives almost the same tones (some small differences due to the chosen color space) and Lr gives a much warmer picture (Raw or treated Jgeg reimported in the catalog). Will it have a preference of Lr to settle?
    Note: the direct opening of RAW file in Photoshop with Camera Raw (same engine as Lr) without special settings, also gives a duller color different image, that directly Lr.
    What is the solution?

    In general, any difference between Lightroom and other color managed software is indicative of a corrupt monitor profile. No idea about Irfanview, but Lightroom, Photoshop and Windows Photo Viewer should all display identically.
    What they all do is convert from the source/document color space to the target color space, which for display is your monitor profile. The result should be identical - that is in fact the whole point of color management. But since the source space may be different the actual conversion itself may also be different. So one conversion may go bad but not others.
    A difference between Library and Develop will have the same explanation (different source spaces; Library is Adobe RGB while Develop is linear ProPhoto).
    It also happens that different applications react differently to a bad monitor profile. It may work in one application and fail in others.
    Any software that is not color managed will simply display in the native monitor color space, which can be anything under the sun, so you can just ignore and disregard that. It won't be accurate anyway.
    So the solution is to have a valid and healthy monitor profile. Then everything color managed will display identically (save for gamut differences, but in practice that only applies if you have a wide gamut monitor. With a standard monitor any source space will have equal or larger gamut than the monitor).
    Some calibration software has been known to not follow specifications strictly at all times, so check for updated software. Or the profile can simply have become corrupt. It happens. A way to test this is to set sRGB as default monitor profile in the OS - or Adobe RGB if you have a wide gamut monitor - and see if the problem clears.

  • What is the main difference between ws_upload and gui_upload?

    Hi All,
    What is the main difference between ws_upload and gui_upload?
    In what contexts should we use these two function modules??
    Thanks,
    Creasy

    search the forum before posting.
    You can find lot of posts related.

  • What is the main difference between BPEL and ESB

    Hi all,
    I am making use ESB in my application .Where the my client application calls ESB and inturn the ESB calls the BPEL process .
    I want to know the differences between BPEL and ESB,I came to know that ESB can do messaging and routing ,where my BPEL process can also do the same thing .
    I came to know form a vendor that ESB is used for connecting to multiple end points ,where as my BPEL process can also do this.
    SO what is main purpose of using ESB ?
    Cheers,
    Kalyan.
    Message was edited by:
    patti

    Hi,
    Look for the blog entry dated 1st october 2007.
    URL:
    http://abhishek-soablog.blogspot.com
    Cheers,
    Abhi...

  • What is the main difference between eewb and aet tool ?

    Dear all,
    What is the main difference between eewb and aet? Both ways we can create fields and coming to aet is in crm 7.0 and eewb is in 6.0.when we are creating fields through eewb we should have technical knowledge but aet tool is a simple tool as a function people also can easily add the fields. I want to know is there any main difference between both these tools.
    Regards,
    Jemmi.

    EEWB works from SAP GUI whereas AET works from WEB UI. AET is developed on top of the EEWB. Most the Objects are supported barring a few through AET. It's a very usefull tool for SAP CRM.
    Since in CRM SAP GUI will be phased out soon, AET will be prominent. One will see lot more features in upcoming relase in AET tool.
    Regards,
    Harshit

  • What is the main difference between Enhancements and BADI.?

    What is the main difference between Enhancements and BADI.?plzz tell
    Edited by: Alvaro Tejada Galindo on Feb 13, 2008 3:48 PM

    CMOD is the Project Management of SAP Enhancements (i.e., SMOD Enhancements). SMOD contains the actual enhancements and CMOD is the grouping of those SMOD enhancements.
    Difference Between BADI and User Exits
    BADI's can be used any number of times, where as USER-EXITS can be used only one time.
    Ex:- if your assigning a USER-EXIT to a project in (CMOD), then you can not assign the same to other project.
    BADI's are oops based.
    Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software. 
    As with customer exits two different views are available:
    In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object. 
    In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.
    In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.
    SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.
    The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example).
    All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task.
    The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects.

Maybe you are looking for

  • HP psc 2175xi Scanning Mac OS X Leopard 10.5.8

    According to the information at the web pages for the HP psc 2175xi AIO, scanning is not possible with Leopard 10.5 and later using the HP Scan Pro package. I got it to work. Powermac G5: Leopard 10.5.8 512MB RAM 250GB SATA HDD DVD-RW PATA interface

  • How can I get mail to automatically update calendar invites without actually opening calendar and disrupting my work?

    I like mail to continue placing new invitations into my calendar so that I can accept (or reject) them when convenient.  However I would like to be able to work in an application without being disrupted whenever someone sends me lots of invitations. 

  • ITune delete pod casts when syncing

    Hi, I download few pod casts on my iPhone and iPad but I don't subscribe them through iTunes. I just use "Get more episodes" link in iPod application. Also in my iTunes I have not selected pod cast sync option. But every time I sync my iPhone or iPad

  • Cuando conecto un disco duro Externo se me cae el WIFI

    Durante mucho tiempo estuve buscando por internet el problema que a veces cuando trataba de conectarme por wifi a la red me decia que no se podia conectar, que me acercara al router, hoy encontre el problema pero no se como solucionarlo, cuando conec

  • Rounding calculation in TM_51/TM_52

    Hi colleagues: I have a problem when using transaction TM_51/TM_52 for creating/change one Interest Rate related to the calculation and rounding procedures. Base in the following model it is possible to get a clear view of the problem: Base amount (i