Our Java instructor always asks us to prove that "Every java program is Object Oriented"
How would I go about proving this is true?
Our Java instructor always asks us to prove that "Every java program is Object Oriented"
How would I go about proving this is true?
Because you cannot have a main that isn't part of a class. Hence a class must exist in order to have a valid program.
But that's really nit-picking since you don't actually have to instantiate that class to do something. You can write a complete program with just static methods that instantiate no objects at all.
Whether it's a useful program without using objects like System.out
is another matter.
Some OO purists will argue that Java isn't pure OO and they're probably right (in my opinion). That doesn't make it any less useful.
See here.This defines the reason why Java is object oriented programming language.
Every java program is not Object oriented due to the presence of primitives and statics.