Can someone explain how the below code works without any exceptions. I am thinking when new instance is created for SUNDAY it creates a new instance for MONDAY (inside SUNDAY) too and then SUNDAY again (inside MONDAY) and so on... Something like recursive as they both are part of the class Week. But my understanding is wrong because the below code is working fine.  public class Week {     public static final Week SUNDAY = new Week("SUNDAY",0);     public static final Week MONDAY = new Week("MONDAY",1);      private String name;     private int val;      private Week(String name, int val) {         this.name = name;         this.val = val;     }      public int getIndex() {         return this.val;     }      @Override     public String toString() {         return this.name;     } }   I got this doubt when I was reading about java enums.
To be specific, I was trying this code:  package hello;  public class Hello {      Clock clock = new Clock();      public static void main(String args[]) {         clock.sayTime();     } }   But it gave the error      Cannot access non-static field in static method main   So I changed the declaration of clock to this:  static Clock clock = new Clock();   And it worked. What does it mean to put that keyword before the declaration? What exactly will it do and/or restrict in terms of what can be done to that object?
Switch from single to double column in the same page What is the distance between the centers? Two unit circles overlap in such a way that exactly half the area of each circle is within the overlap. How far apart are the centers of the two circles? Prove the function is continuous, exercise from Conway's "Functions of One Complex Variable I" Why did the writers select the date November 5, 1955 in Back to the Future? Is there any significance to the date November 5, 1955 that was chosen in Back to the Future? Is it one of the directors birthday or something like that or were there specific real life events that day in history?   I am not looking for in-universe answers. Why does a RegExp with global flag give wrong results? Why do harmonics occur when you pluck a string? Replacing the core of a solenoid to increase the pulling force How to assess the similarity of two histograms? Given two histograms, how do we assess whether they are similar or not?  Is it sufficient to simply look at the two histograms? The simple one to one mapping has the problem that if a histogram is slightly different and slightly shifted then we'll not get the desired result.  Any suggestions? Solve $$u_{xx}-3u_{xt}-4u_{tt}=0$$ where $u(x,0)=x^2$ and $u_t(x,0)=e^x$.  My workings so far: I have factored the differential equation in the following way: $$(\delta_x-4\delta_t)(\delta_x+\delta_t)=0$$ where $\delta_x=\frac{\delta}{\delta x}$ etc. Now if we let $v$ be the solution to $(\delta_x+\delta_t)u$ then we have the following two equations: \begin{eqnarray*} (\delta_x+\delta_t)u=u_x+u_t=v\\ (\delta_x-4\delta_t)v=v_x-4v_t=0 \end{eqnarray*} Now for $v$ we simply find $$v=h(t+4x)$$ where $h$ is an arbitrary function of one variable. Now what remains is find $u$ such that $$u_x+u_t=h(t+4x)$$ I am stuck here, I thought about making a change of variables $\zeta=x+t$ and $\eta=x-t$ and thus using the product rule to show that $u_x=u_{\zeta}+u_{\eta}$ and $u_t=u_{\zeta}-u_{\eta}$ and thus $u_x+u_t=2u_{\zeta}$ and we need to solve $$u_{\zeta}=h(t+4x)$$ (I left out the factor 2 because $h$ is an arbitrary function). Do I simply integrate now and conclude $$u=f(\zeta)h(t+4x)+g(\eta)=f(x+t)h(t+4x)+g(x-t)$$ This seems wrong to me...  Some help would be greatly appreciated! There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing.  I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex indy code to my application.  UPDATE: sorry if I was not clear, I meant by "not to add complex indy code", that I don't want add indy components for just this simple task, and prefer more lighter way for that. Trying to understand what is a p value I am trying to understand what a p value is and what is its importance in statistics, from this example.  For $50$ specimens of alloy steel the rock hardness scale measured an average of $62$ with standard deviation $8$ he manufacturer claims that the alloy has average strength of $64$ at significance of $0.01$ can you refute this?  Well I did this problem and saw no at this level you cant refute it , I use the null being that the hardness was $64$ and the alternate that the hardness was less then $64$. From the data we observe a $z=-1.7677$ but the chart is $z=-2.33$ and so we cant refute null at this level.  But now I want to understand what the p value would be ,  I thought it was that the p-value is the probability of getting the observed value of the test or a value with even more evidence against the null if the null is actually true. So using that I just look on the z chart, the probability of seeing Z greater then $1.7677$ is $0.0384$, so is that the p value? Best resources to learn bash scripting? Why would someone buy a way out-of-the-money call option that's expiring soon? I swing trade equity options every once in a while for fun. This morning I witnessed something I do not understand at all.  In the attached photo, why would someone purchase 6 contracts for .05 at $76.  I just can't wrap my head around this!    Scenario:   Underlying Asset: RY.TSX  Current Price: $71.70 Days to expiry: 4 Days     EDIT: It happened again the next day with 74, see new table with headers as per request:   My only reason for asking is because RY.TSX is the Royal Bank of Canada, this stock will not move multiple dollars in 3 days(expiry in this scenario).  Why buy 10 @ 74 for .04 each instead of just buying 10 @73 for .04 which would have gone through.  If you do the math(excluding commissions): .04 * 100(shares in a contract) * 10 contracts = $40 Stock moves to 74 and they are in the money lets say for .20 .20*100*10 = $200  I just don't see the reward as 99% of the time you will lose this wager, it is just not worth it even if it does happen once in a blue moon.  I can think of much better things to do with $40.  For the skeptics another screen shot to actually confirm this order: Replace symbols with values without evaluation Just a curiosity. I just saw a video where pi was being calculated by the series  $$1-(1/3)+(1/5)-(1/7)+...$$  My question is how can $\pi$ be irrational if we can calculate it using rational numbers? Let $S=\{1,2,3,4,\dotsc,N\}$ and $X=\{ f: S \rightarrow S \mid x < y \Rightarrow f(x)\leqslant f(y)\}$. Then $|X|$ is equal to what? Does Wolfram Mathworld make a mistake describing a discrete probability distribution with a probability density function? Any thoughts on a semidecadian badge for people with five years service and an average of N points per year? Given that Stack Overflow is close to its fifth birthday as a public site, has any thought been given to a 'semidecadian' badge for people who have:   been registered with the site five years (a semi-decade, hence the name), scored more than N points per year on average (where N might be 1000).   The idea behind 'average of N points per year' is to allow slow starters to gain the badge eventually, rather than ruling them out in year 1.  The details are obviously subject to tweaking.  This might be a gold badge (the platinum version would be the decadian badge, with a larger value of N required — and no-one eligible for another 5 years or so).  These would complement the current Yearling badge (which is silver). What is butterfly lighting, and when do I use it? I often hear the term 'Butterfly Lighting' used when discussing high-fashion and glamor photography. How do I set up Butterfly Lighting, and when do I use it? "He walks as if he is drunk." Grammatically correct ? Any difference in meaning from "...as if he were drunk."? Is it grammatically correct to use an indicative verb after "as if", or "as though" for that matter?        I've heard someone say: "He walks as if he is drunk."  Would there have been any difference if he had said "He walks as if he were drunk."?   A second example might be:        It looks as if it is going to rain.   It looks as if it were going to rain.