Quantcast
Channel: Learn Java Programming
Browsing latest articles
Browse All 39 View Live

Reading XML File : Using Java and DOM Parser

package com.c4learn; import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import...

View Article


Super Keyword : Access Class Variables & Methods

In the previous chapter of inheritance we have learnt about the different rules of method overriding, In this chapter we will be learning about the super keyword - 3 ways of Using Super Keyword : Super...

View Article


Super Keyword and Constructors : in Java

Consider the following simple example of inheritance, We have created an object of child class - Understanding Constructors : package com.c4learn.inheritance; public class ParentClass { public...

View Article

Java Final Keyword

Final Keyword is used to stop user accessing the java variable or class or method. We can use final keyword in following three manner - Making Final Variable Making Final Method Making Final Class Way...

View Article

Inheritance Questions : Interview Tips and Questions

We have just studied the final keyword and different usage of final keyword. In this chapter we have listed some of the frequently asked interview questions on the Final Keyword - We have Listed Some...

View Article


Java Interview Question #1 : Is Final Method more efficient in Java ?

Que 1. Final Vs Non Final Method, Which is more efficient ? Answer : Final Final methods execute more efficiently than non final method. Compiler knows at compile time that a call to a final method...

View Article

Java Interview Question #2 : Can Java inherit Final Method ?

Que 2. Can we inherit Final Method ? Answer : Yes In case of final method, Method is inherited but cannot be overriden so always method from parent class will be executed. Consider the following...

View Article

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

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...

View Article


Java Type Casting : Inheritance

Converting one type of value to another is called as Type Casting. Different Forms of Type Casting : There are two types of type casting. Live Example of Type Casting in Inheritance : package...

View Article


Packages in Java

Packages are containers for classes. Packages are collection of similar type of classes in Java. In java there are two types of packages – User Defined Package and Built in Packages. A. Need of...

View Article
Browsing latest articles
Browse All 39 View Live