William John Foster was a politician and Supreme Court judge in colonial New South Wales, Attorney General of New South Wales 1877 to 1878. Foster was born in Rathescar, County Louth, Ireland, the son of Rev. William Henry Foster of Loughgilly, County Armagh, and his wife Catherine, née Hamilton. Foster was educated at Cheltenham College, and at Trinity College, Dublin, where he took the Vice-Chancellor's prize for Greek in 1850, also the composition prize in the same year, as well as honours in classics and mathematics. He left the University in 1851. Foster arrived in Sydney in August 1854, and for the first three years of his residence in New South Wales devoted himself to agricultural pursuits. He then studied law, and was called to the colonial bar in 1858, when he entered on the practice of his profession. In 1859 he published a work on the District Courts Act, which was the standard work on the subject until 1870, when a revised edition was issued. In 1877 be published a supplement to the same work. He acted as a Crown prosecutor from 1859 to 1862 and from 1864 to 1870, when he was appointed Crown Prosecutor for Sydney, in succession to Mr. Butler, who had accepted the Attorney-Generalship. In December 1877 Foster resigned as Crown Prosecutor, and became Attorney-General in the Farnell Administration, with a seat in the New South Wales Legislative Council. Retiring with his colleagues in December 1878, he again took office in October 1881, being Minister of Justice in the Parkes Administration from that date till Jan. 1883, when the Government resigned. He retired from the Legislative Council in 1880, and was returned to the New South Wales Legislative Assembly for Newtown. In 1882 he was defeated, but was re-elected in 1885, and sat in the Assembly till he retired from political life in 1888. Foster was made Q.C. in 1886, and in the following January he again took office as Attorney-General under Sir Henry Parkes, but resigned in February 1888, on the ground that his prior claim to the vacant Puisne Judgship had been slighted. Later in the same year he was raised to the Supreme Court Bench. Foster married in 1854 Matilda Sophia, daughter of John Williams, of Landigige, Pembrokeshire. He on several occasions refused District Court Judgeships, and declined the Speakership of the Assembly in 1887. Foster died in Valley Heights, Sydney, New South Wales, Australia on 16 August 1909.