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 ArticleJava 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 ArticleJava 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 ArticleJava 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 ArticleJava 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 ArticleInheritance 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 ArticleJava 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 ArticleSuper 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 ArticleSuper 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 ArticleReading 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 ArticleJava Substring : (String Operations)
In the last topic we have learnt about comparison of two strings and different ways of comparing strings. In this topic we are going to see finding out the substring in Java. Java Substring : Method 1...
View ArticleJava Comparing Strings : (String Operations)
In the last topic we have learnt Concatenating Strings in Java. In this chapter we are looking another String operation in Java Programming i.e Comparing two Strings. There are three ways for comparing...
View ArticleWhat is Java ?
What is Java ? Java is widely used programming language which has wide verity of applications such as desktop applications, Mobile Applications, Enterprise applications etc. Five primary goals in the...
View ArticleFeatures Supported in Java
Java is derived from C++. Though some features of C++ were added in Java still there are lot many features that are removed from java.The post Features Supported in Java appeared first on Learn Java...
View ArticleJava Exception propagation
A. Exception Propagation : Unchecked Exception Before explaining the concept of exception propagation , review the below code with care - class ExceptionPropagation{ void method3(){ int result = 100 /...
View ArticleInstanceOf Keyword : Check Whether a Class is instance of Another class
In the previous chapter we have learnt about the IS-A relationship between subclass and superclass. In this chapter we will be learning the programatic implementation of IS-A relationship. Example :...
View ArticleIS-A Relationship : Java – Inheritance Tutorial
Java – Inheritance Basics : IS-A Relationship with Example : IS-A is a way of saying : This object is a type of that object. public class Vehicle{ } public class FourWheeler extends Vehicle{ } public...
View Articlethrow Keyword : explictily throw an exception
throw Keyword : The throw keyword is used to explictily throw an exception. We can throw either checked or uncheked exception. The throw keyword is mainly used to throw custom exception. Requirement :...
View ArticleFinally block : Exception Handling in Java Programming
In the previous chapter we have studied the nested try and catch blocks in this chapter we will be learning the finally block.Finally block : Exception Handling in JavaFinally Block in always executed...
View ArticleNested Try Block Statement : Exception Handling in Java
Sometimes situation occurred, where we need to catch multiple conditions. In the previous tutorial we have learnt about the catching multiple exception using only one catch block. In this chapter we...
View Article