Java Programming and Technical Programming Definition

Q. Why there are no global variables in Java?

A. Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:
1)The global variables breaks the referential transparency
2)Global variables creates collisions in namespace

Read Solution (Total 0)

Java Other Question

Q. What is the Java API?

A. The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets
Q. What are Encapsulation, Inheritance and Polymorphism?

A. Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Inheritance is the process by which one object acquires the properties of another object. Polymorphism is the feature that allows one interface to be used for general class actions.