Asked by prasanna
                can we create two variables of same name and of different datatype?
            
            
        Answers
                    Answered by
            MathMate
            
    As you can see from the above reference, the same question can be answered differently for different languages.
In general, most modern programming languages do not permit the same name applied to different types because it would be confusing for the compiler.
There could be exceptions where scalars and arrays have different name spaces (e.g. Perl). Even then, the arrays have a prefix (@). So @name and name are different variables.
    
In general, most modern programming languages do not permit the same name applied to different types because it would be confusing for the compiler.
There could be exceptions where scalars and arrays have different name spaces (e.g. Perl). Even then, the arrays have a prefix (@). So @name and name are different variables.
                                                    There are no AI answers yet. The ability to request AI answers is coming soon!
                                            
                Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.