Powered by Blogger.

Friday 16 September 2016

Java Questions

By Unknown  |  02:03 No comments

Can we override static method?
No, we can't override the static method because they are the part of class not object and it is bound with class whereas instance method is bound with object and static gets memory in class area and instance gets memory in heap.

Can we override the overloaded method?
Yes.

Can we define private and protected modifiers for variables in interfaces?

No, they are implicitly public.

Static Import:

The static import feature of Java 5 facilitate the java programmer to access any static member of a class directly. There is no need to qualify it by the class name.
Advantage of static import:

Less coding is required if you have access any static member of a class oftenly.
Disadvantage of static import:

If you overuse the static import feature, it makes the program unreadable and unmaintainable.


All wrapper classes in java.lang are immutable, i.e. String, Integer, Boolean, Character, Byte, Short, Long, Float, Double, BigDecimal, BigInteger


Author: Unknown

Hello, I am Author, decode to know more: In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In commodo magna nisl, ac porta turpis blandit quis. Lorem ipsum dolor sit amet.

0 comments:

Recent Articles

© 2014 Learning Java. WP themonic converted by Bloggertheme9. Published By Gooyaabi Templates
TOP