Valid 1z0-808 Dumps shared by ExamDiscuss.com for Helping Passing 1z0-808 Exam! ExamDiscuss.com now offer the newest 1z0-808 exam dumps, the ExamDiscuss.com 1z0-808 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 1z0-808 dumps with Test Engine here:
Given: package p1; public interface DoInterface { void method1(int n1); // line n1 } package p3; import p1.DoInterface; public class DoClass implements DoInterface { public DoClass(int p1) { } public void method1(int p1) { } // line n2 private void method2(int p1) { } // line n3 } public class Test { public static void main(String[] args) { DoInterface doi= new DoClass(100); // line n4 doi.method1(100); doi.method2(100); } } Which change will enable the code to compile?
Correct Answer: C
Private members (both fields and methods) are only accessible inside the class they are declared or inside inner classes. private keyword is one of four access modifier provided by Java and its a most restrictive among all four e.g. public, default(package), protected and private. Read more: http://javarevisited.blogspot.com/2012/03/private-in-java-why-should-youalways.html#ixzz3Sh3mOc4D