0
Why we declare type?
I'm not clear why we declare a type infrount of the variable in java? Is there a simple way to think about it?
5 Respuestas
+ 1
HBhZ_C I still not getting it 😅 does it determin what data can be used on that variable?
0
Read about typing languages.data type is required to declare a variable or a function vs interpreted languages where no need to added datatype in variables declaration.In the first kind of lang. there are a compiler which require datatype to convert code to binary .
0
Yes without data type your compiler can not understand what you want.It has no more intelligence to distinguish alone what data type the declared variable are not like python which has an interpreter used to implicitly adding correspondant datatype.
0
NotAPythonNinja & HBhZ_C so when I declare a variable like so
Program x
What is that actually doing before I assign a object to it? Thanks
0
You talk about oop programming you declare x as an object of the class Program.Program must be firstly declared as class if not Program will be a user defined datatype in c programming language.