Java Quiz: Static Members in Java

2016-05-05 07:01:05

Last Week's AnswerThe correct answer is the code writes "[d, a, b, e]" to the standard output.This Week's QuizPurposeTo demonstrate some behaviors and tricks of static members in JavaMind training to understand what happens next.What Happens When the Following Program is Compiled and Run?public class MyClass { static int x; StringBuffer sb = new StringBuffer(); static StringBuffer sb2 = new StringBuffer(); public MyClass() { method(); method2(); } public void method(){ x += 3; sb.append(x); } public void method2(){ x += 3; sb2.append(x); } public static void main(String[] args){ MyClass mc = new MyClass(); MyClass mc2 = new MyClass(); MyClass mc3 = new MyClass(); System.out.println(mc2.sb + "-" + mc2.sb2); } }Let us know your thoughts in the comments, and visit Sar's site here!

Couchbase 4.5 Beta Is Now Available – Faster, Simpler, More Secure

2016-05-04 23:27:05

Couchbase 4.5 Beta is now available, download!This release has three main themes: Here is the list of features that you can now play with:FasterSub Document APIMemory-Optimized Global IndexesArray IndexingFaster Read-Your-Own-Write Consistency with N1QL QueriesImproved Index Write Performance with Circular WritesFlexible Commutative JOINs in N1QLSimplerIntegrated Query WorkbenchQuery MonitoringCommand-line shell for N1QLIntegrated Full Text Search and new Search Service (Developer Preview)Enterprise Backup and RestoreSecureX.509 Certificate-based SecurityRole Based Access Control for AdministratorsMore details in What’s New in Couchbase 4.5 Beta!Read more details in Introducing Couchbase Server 4.5 Beta.Some references for you…Couchbase 4.5 Beta Landing PageCouchbase 4.5 DownloadsCouchbase 4.5 Beta DocsCouchbase 4.5 Beta Release NotesCouchbase 4.5 Beta YouTube PlaylistEnjoy!

Twitter lawsuit partly dismissed over U.S. information requests

2016-05-03 00:37:05

SAN FRANCISCO A U.S. judge on Monday partly dismissed a lawsuit filed by Twitter Inc (TWTR.N) in which the social media company argued it should be allowed to publicly disclose more details about requests for information it receives from the U.S. government.U.S. District Judge Yvonne Gonzalez Rogers in Oakland, California also gave Twitter the opportunity to re-file its lawsuit to include more details about government decision-making, in order to try to move its claims forward. (Reporting by Dan Levine; Editing by Bill Rigby)

Second European-Russian mission to Mars delayed to 2020

2016-05-02 19:57:05

MOSCOW The second stage of a joint European-Russian mission to search for signs of life on Mars has been delayed from 2018 to 2020, the European Space Agency and Russia's Roscosmos said on Monday.The new planned launch date for the second ExoMars mission was July 2020, Interfax news agency cited state-run Roscosmos as saying.It will incorporate a Russian-led surface platform and European-led rover, to be launched from the Baikonur spaceport in Kazakhstan. The decision to put back the launch was a joint one that took into account delays in European and Russian industrial activities, the European agency said in a statement. A spacecraft left Baikonur in March in the first stage of the program.It carried an atmospheric probe that is to study trace gases such as methane -- a chemical that on Earth is strongly tied to life - that previous Mars missions have detected in the planet's atmosphere. The craft is due to arrive in October. The second-stage rover is meant to be the first with the ability to both move across Mars' surface and drill into the ground to collect and analyze samples. Roscosmos was not available for comment on Monday, a public holiday in Russia. (Reporting by Alexander Winning and Scot Stevenson; Editing by Alison Williams and John Stonestreet)

Facebook hit with lawsuit over plan to issue new stock

2016-05-01 01:21:07

SAN FRANCISCO A Facebook Inc (FB.O) shareholder filed a proposed class action lawsuit on Friday in a bid to stop the company's plan to issue new Class C stock, calling the move an unfair deal to entrench Chief Executive Mark Zuckerberg as controlling shareholder.The lawsuit, filed in the Delaware Court of Chancery, followed the social networking company's announcement on Wednesday of its plan to issue the shares.The rejiggering of Facebook's share structure is effectively a 3-for-1 stock split. Zuckerberg's said in December that he intends to put 99 percent of his Facebook shares into a new philanthropy project focusing on human potential and equality.The lawsuit contends that a Facebook board committee which approved the share deal "did not bargain hard" with Zuckerberg "to obtain anything of meaningful value" in exchange for granting Zuckerberg added control. In a statement, Facebook said the plan "is in the best interests of the company and all stockholders." The company has said keeping Zuckerberg at the helm is key to its future success.Facebook plans to create a new class of shares that are publicly listed but do not have voting rights. Facebook will issue two of the so-called "Class C" shares for each outstanding Class A and Class B share held by shareholders. Those new Class C shares will be publicly traded under a new symbol. Zuckerberg "wishes to retain this power, while selling off large amounts of his stockholdings, and reaping billions of dollars in proceeds," the lawsuit said."The issuance of the Class C stock will, in effect, have the same effect as a grant to Zuckerberg of billions of dollars in equity, for which he will pay nothing," it said. Google settled a lawsuit in 2013 shortly before trial which cleared the way for that company to execute a similar plan. (Reporting by Dan Levine; Editing by Bernard Orr and Tom Brown)

Older Post
Oslo trash incinerator starts experiment to slow climate change
Facebook VP says Brazil jailers treated him with respect
Yahoo sets April 11 deadline for preliminary bids: WSJ