Tags:Dot Net Questions | 1,992 views
When do you use virutal keyword?. When we need to override a method of the base class in the sub class, then we give the virtual keyword in the base class method. This makes the method in the base class to be overridable. Methods, properties, and indexers can be virtual, which means that their implementation [...]
Tags:JAVA Questions | 110 views
Java Access Specifiers
The access to classes, constructors, methods and fields are regulated using access modifiers i.e. a class can control what information or data can be accessible by other classes. To take advantage of encapsulation, you should minimize access whenever possible.
Java provides a number of access modifiers to help you set the level of access [...]
Tags:JAVA Questions | 174 views
What is the difference between Abstract class and Interface
Or
When should you use an abstract class, when an interface, when both?
Or
What is similarities/difference between an Abstract class and Interface?
Or
What is the difference between interface and an abstract class?1. Abstract class is a class which contain one or more abstract methods, which has to be implemented by [...]
Tags:JAVA Questions | 93 views
Do I need to import java.lang package any time? Why?Or
Which package is always imported by default?
No. It is by default loaded internally by the JVM. The java.lang package is always imported by default.
Can I import same package/class twice? Will the JVM load the package twice at runtime?
One can import the same package or same class [...]