Quantcast
Channel: Learn Java Programming
Viewing all articles
Browse latest Browse all 39

Java Interview Question #3 : Can Java have blank final Value ?

$
0
0

Que 3. Can Java have blank final Value ? Answer : No package com.c4learn.inheritance; public class BlankFinalValue { final int myValue; public BlankFinalValue(){ this.myValue = 3; } public static void main(String[] args) { BlankFinalValue s1 = new BlankFinalValue(); } } Output : Compiler Successfully Explanation : We cannot have final Value which is uninitialized. You(...)

The post Java Interview Question #3 : Can Java have blank final Value ? appeared first on Learn Java Programming.


Viewing all articles
Browse latest Browse all 39

Trending Articles