Citigroup Interview Question for Java Developers


Country: India




Comment hidden because of low score. Click to expand.
1
of 1 vote

Interface shouldn't have private methods

- rkvn October 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Any method declared in Interface must on private or protected, because this method has to be implemented later on. You are only allowed to use public and abstract access modifier in interface.

- Manoj Sharma October 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interface cannot have private methods, as the methods in an interface needs to be overridden by the class that is implementing the interface. But declaring a method as private makes in inaccessible outside the class thus not allowing a proper definition.

- Ratan rao October 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interface can have only public and abstract method and final variable.
these method is override by those class which will going to implement that interface.

- Monu October 17, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interface methods should be public

- Hari October 25, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

There is only one wrong statement:

void myMethod();

Interface methods are implicitly public and abstract, and you cannot declare an interface method private because you have to implement that method in your class.

- Nora November 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

private void myMethod3();

Interface methods can't be private.

- sreenivas November 05, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interface can have either public or package protected methods.

- lusinemovsisyan86 November 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

interface doen`t have private methods
so error at private void myMethod3();

- sandy November 27, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interface method can't me private.

- cCAACc November 30, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

interface must contain public static final variable ..

- Anonymous December 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

interface must contain public static final membars

- Anonymous December 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Interface method can't be private. Only public or abstract modifiers allowed to define in interface method definition.

- Thiru December 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

interface cannot contain private,static final method.
so wrong one is private void myMethod3();

- Manu April 13, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Interface should be declared as public

- Anonymous October 16, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

No, if you omit the visibility modifier then the default applies (which is package protected) so this interface can only be implemented by classes which are in the same package as the interface.

- Anonymous October 30, 2013 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More