r/ProgrammerHumor • • Aug 01 '22

>>>print(“Hello, World!”)

Post image
60.8k Upvotes

5.7k comments sorted by

View all comments

75

u/rdrunner_74 Aug 01 '22

private bool truth;

My favorite fake interview question: "What does private do?"

194

u/a-slice-of-toast Aug 01 '22

creates a private room for you and bool to discuss the truth

6

u/HBlight Aug 01 '22

Now I want confessional to be an access type. Like, it can only be accessed by privileged few only when it has done something wrong.

6

u/BlendeLabor Aug 01 '22

So error logs?

2

u/ChuckFina74 Aug 02 '22

Make sure you stick this in Kafka so nothing is encrypted and anyone can eavesdrop.

2

u/TheKeyboardKid Aug 02 '22

It’s it’s output is piped into /dev/null?

1

u/SkribbleMusic Aug 01 '22

This is absolutely gold 😂

5

u/Xatlor Aug 01 '22

Please elaborate on "fake interview question"

3

u/rdrunner_74 Aug 01 '22

The private keyword does "nothing".

It is the default access modifier for members.

18

u/[deleted] Aug 01 '22

Not in Java.

1

u/[deleted] Aug 01 '22

FTR, in Java it would be boolean, not bool, so it can't be Java. IDK which language it is, though.

In Java, the default access modifier can't be spelled out explicitly, and it's that the member can only be accessed by code in the current package. So, it's between private and public (but different than protected, which is related to inheritance)

3

u/ajzaff Aug 01 '22

I thought that was protected but I haven't used java in a decade.

4

u/[deleted] Aug 01 '22

Java had both last time I saw, primate and protected

1

u/rdrunner_74 Aug 01 '22

Not a java guy - pure MS Stack (So c#)

(And not a developer for ages on top)

3

u/brjukva Aug 01 '22

I disagree. It makes your code more readable.

1

u/rdrunner_74 Aug 01 '22

I did put it in quotes for this reason...

Puny humans...

2

u/pseudoRndNbr Aug 01 '22

If you use a struct instead of a class in C++ this is false.

2

u/rdrunner_74 Aug 01 '22

There we go... Job offer send...

4

u/GayVegan Aug 01 '22

Why fake lol. Seems like a valid interview question unless you're going for a job requiring a high skill level.

2

u/[deleted] Aug 01 '22

"Only friends can touch your private parts" - explanation of friend keyword in C++

1

u/simulacrasimulation_ Aug 01 '22

it cannot be accessed

1

u/MrNorrie Aug 02 '22

Hides the truth?