Tuesday, April 17, 2018

Why the java.lang.System neither abstract nor instantiable

It’s to prevent you from making a subclass that can be instantiated. In Java:

* an abstract class cannot be instantiated, but its subclasses can be

* a final class cannot be subclassed

* a class cannot be both final and abstract

The System class has a private constructor to prevent you from instantiating it (this is good practice for “utility classes”), and it is final to prevent you from getting around that by creating a subclass that has a usable constructor. And because it is final, it cannot be abstract

Regards: https://www.quora.com/Why-isn-t-the-Java-lang-system-class-in-Java-an-abstract-when-it-cannot-be-instantiated/answer/Jon-Harley?share=782923fd&srid=h5t7z

Wednesday, March 28, 2018

What, If i reject you in this interview

This question is asked to check the performance of the candidate under stress.

When the interviewer asks this question, you are already in his top list.

Interviewer- What is the answer of "If I reject you in this interview then what will you do"?

Don’t get tensed. Keep your cool. Think about your interviewer. Be a bit empathetic.

Worst answer

I will learn and make myself better. I won’t get hurt bla bla bla.

(Nobody wants to hire someone who is self centered and thinks about himself only).

Good answers

I’m sorry that I wasted your time, Sir. Have a wonderful day ahead. Hope you find the right candidate.

or

I will eat something good in my lunch and will watch Game of Thrones (with a humour).

or

(If it is a campus interview)

You can say “Okay Sir. No problem. Let me know if I can help you with any other thing. If you want, I can be your guide for a local tour.”

(Companies hire people who can work continuously without losing their cool in stressful conditions.)

Best Answer (If you want to take a risk)

You- Of course, you can reject me.

(Treat the interviewer as your client. First agree with him. Keep your cool.)

Interviewer- Okay. I’m going to reject you.

You- But!!!

Interviewer- But what?

You- Will you find another candidate like me?

(You just questioned his decision. He has to think again.)

Interviewer- I will try to find a better one.

(But, when, how, where? lots of probability.)

You- It may take you some time, Sir. But, what if you won’t find a good candidate like me?

(You just stated him the consequences if he won’t select you today.)

Interviewer- I will call you and hire you. Is that okay?

You- Do you think, I will be available for hiring?

(You just created an urgency. If he won’t hire you today, he will lose you for ever.)

What you think, will you get hired after this?

I’m sure, you will get selected…

Regards : Quora - Barun Mohanty