Sreemaha has Published 63 Articles

What is the difference between method hiding and method overriding in Java?

Sreemaha

Sreemaha

Updated on 30-Jul-2019 22:30:20

2K+ Views

When super class and the sub class contains same instance methods including parameters, when called, the super class method is overridden by the method of the sub class. WIn this example super class and sub class have methods with same signature (method name and parameters) and when we try to ... Read More

How do I write variable names in Java?

Sreemaha

Sreemaha

Updated on 30-Jul-2019 22:30:20

4K+ Views

While choosing an identifier to declare a variable in Java you need to keep the following points in mind. The name of the variable should begin with either alphabet or, an underscore (_) or, a dollar ($) sign. The identifiers used for variables must not be keywords. No spaces ... Read More

Why are classes sometimes declared final in Java?

Sreemaha

Sreemaha

Updated on 30-Jul-2019 22:30:20

633 Views

If a class is declared final, you cannot inherit it. If you try it gives you a compile-time error as − Example final class Super { private int data = 30; } public class Sub extends Sub { public static void main(String args[]){ ... Read More

Previous 1 ... 3 4 5 6 7
Advertisements