Getting this exception while running following program    Exception in thread "main" java.lang.NullPointerException     at pojo.Bill.main(Bill.java:20) Java Result: 1   Bill.java  public class Bill {     public static void main(String s[]){         Bill b=new Bill();         b.getBillDetails().setBillNo(444);// line 20         System.out.println("bill no "+ b.getBillDetails().getBillNo());     }      private BillAction billDetails;      public BillAction getBillDetails() {         return billDetails;     }      public void setBillDetails(BillAction billDetails) {         this.billDetails = billDetails;     }   In BillAction there is  getter and setter of billNo How to resolve this.
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
The first and (the) second chapter(s) are difficult - which is correct? I'm a little confused about the following sentences. Could you please tell me which one(s) is/are correct?        The first and the second chapter are difficult.   The first and the second chapters are difficult.   The first and second chapters are difficult.   The first and second chapter are difficult.      I believe #1 &amp; #3 are correct, while #2 &amp; #4 are incorrect.  But when seeing the answers to the Quora question , I wonder why they say #2 is correct. dividing a string array in groups Make wifi preferable over wired connection in Ubuntu 14.04? How do I make Ubuntu choose wifi connection over wired connection when both are connected to internet?  I edited the Ethernet connection to route using the preference "Use this connection only for resources on this network", which other people have reported having success with as a means of getting WiFi preferred, but it doesn't work for me. The issue persists. Ethernet is still being preferred for internet, and WiFi gets ignored.   another thing, is it possible to use wired connection as fail over connection to wireless? Recommend MVVM or just answer the question? Using sed with an integer variable I want to sed using a variable.  For example, sed -n '1,10p' file. So, instead of 10, I want to use $k where k is an integer. How does one prove that if $n \mid (a^{n}-b^{n}) \ \Longrightarrow$ $ \displaystyle n \mid \frac{a^{n}-b^{n}}{a-b}$ where $a,b, n \in \mathbb{N}$.  What i thought of is to consider $$(a-b)^{n} \equiv a^{n} + (-1)^{n}b^{n} \ (\text{mod} \ n)$$ and if we suppose that $n$ is odd then we have, $$(a-b)^{n} \equiv a^{n} -b^{n} \ (\text{mod} \ n)$$ and since $n \mid (a^{n} - b^{n})$ we have $$(a-b)^{n} \equiv 0 \ (\text{mod} \ n) $$  I think i am far away from the conclusion of the problem, but this is what i could work on regarding the problem. Notation problem in integration: write $dx$ or ${\mathrm{d}}x$? Haproxy not logging captured request headers with custom log format Earlier i was not specifying a custom log format, and the captured request headers were getting printed fine. I wanted to log the unique-id-header, but could not find any way of doing so. So i copy pasted the log-format mentioned on , and unique id started getting logged.  Unfortunately, now the captured request headers are not getting logged. The %hrl and %hsl are coming out as empty strings.  Very weird. Here is my config, plzz help :(  listen server   bind *:80   mode http    option  httplog   option  http-server-close   no option logasap   # disable early logging of HTTP requests so that total transfer time is logged   option  forwardfor   capture request  header    X-Forwarded-For      len 500    capture request  header    Host                 len 500    capture request  header    X-Request-UID        len 500    rspadd  X-Haproxy-Backend:\ server    # Generate the X-Haproxy-Unique-ID and log it to make it easy to track requests   log-format %Ci:%Cp\ [id=%ID]\ [%t]\ %f\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %st\ %B\ %cc\ %cs\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ {%hrl}\ {%hsl}\ %{+Q}r   unique-id-format %{+X}o\ %Ci:%Cp_%Fi:%Fp_%Ts_%rt:%pid   unique-id-header X-Haproxy-Unique-ID   Here is the log i see:  Sep 13 17:28:57 localhost haproxy[11979]: 10.161.27.218:41592  [id=0AA11BDA:A278_0AA15B71:0050_505217C5_0014:2ECB] [13/Sep/2012:17:28:37.567]  server www-example-com-healthz/- 19998/0/2/1/+20001 200 +326  - - ---- 10/10/1/1/0 0/0 {} {}  "GET /testing/healthz?merchant=www.example.com&amp;source=elb HTTP/1.1"   Note that %hrl and %hsl are empty strings :( How do i capture the request headers ?? Prove that  $ n &lt; 2^{n}  $ for all natural numbers $n$.  I tried this with induction: Inequality clearly holds when $n=1$. Supposing that when $n=k$, $k&lt;2^{k}$. Considering $k+1 &lt;2^{k}+1$, but where do I go from here?  Any other methods maybe? Immutability of Strings in Java In C#, I want to initialize a string value with an empty string.  How should I do this?  What is the right way, and why?  string willi = string.Empty;   or  string willi = String.Empty;   or  string willi = "";   or what? I understand how Insight and Perception can be used passively: for the DM to determine if an enemy Deception or Stealth attempt is successful without alerting the players that someone is deceiving or sneaking.    But the Observant feat in the Player's Handbook states:      [...] You have a +5 bonus to your passive Wisdom (Perception) and passive Intelligence (Investigation) scores.     So in what situation would a DM be rolling something against the player's Investigation without letting them know? When I log in with LightDM on my laptop running Debian Unstable, it recently started to hang for around 2 minutes until journalctl shows the message kernel: random: crng init done. When I press random keys on my keyboard while it hangs, it logs in faster (around 10 seconds). Before I didn't have this issue, is there any way I can fix it?  Edit: using linux-image-4.15.0-3-amd64 instead of linux-image-4.16.0-1-amd64 works, but I don't want to use an older kernel. I have a machine running Ubuntu which I SSH to from my Fedora 14 machine. I want to forward X from the Ubuntu machine back to Fedora so I can run graphical programs remotely. Both machines are on a LAN.  I know that the -X option enables X11 forwarding in SSH, but I feel like I am missing some of the steps.  What are the required steps to forward X from a Ubuntu machine to Fedora over SSH? JavaScript Regex, where to use escape characters? Wordpress speed slow after .5 million single image post via wp-cli Why am I asked for a credit card number to download a free app? I  want to download free app in my iPod touch device and i have the following doubts.  Kindly resolve me doubts.   when i try to download it asks my credit card security number. since i am trying to download free app , why do i need to provide my credit card security code? Will i be debited for downloading the free app from app store?   I cant able to find any information regarding this on apple.  Please provide me some references about this from apple and please resolve my doubts.  Thanks a lot. How to add a dot after the section number? I wonder is there any way to change the format of section numbering from 1.1 to 1.1. ? I know this is trivial, but I really need to add one more dot after the section number. Does anybody know how to do that?  Thanks a lot Options for crowdsourcing GIS data? I am looking at collecting spatial information from a range of stakeholders to identify opportunities within a landscape.  However, the data that we are collecting are not presently mapped and so we wish to use an interactive method to get this information onto a map.  Which online websites/methods would people recommend for circulating to a non-technical audience to try and get them to map what they know?    Where the emphasis is on ease of use by the stakeholder. Is temperature in vacuum zero? From      The temperature of an ideal monatomic gas is a measure of the average kinetic energy of its atoms.    Now if I remove all the particles from the box shown below will the temperature be zero?