Matrix Addition - Java Program
When you add two matrices addition is done index wise you add the element at (0, 0) in the first matrix with the element at (0, 0) in the second matrix, element at (0, 1) in the first matrix with the...
View ArticleWhy no multiple inheritance in Java
Inheritance is one of the four fundamental OOP concepts. It can be defined as a mechanism, by which one class acquires, all the properties and behaviors of another class. Java being an object oriented...
View ArticleMatrix Subtraction - Java Program
When you subtract two matrices subtraction is done index wise you subtract the element at (0, 0) in the first matrix with the element at (0, 0) in the second matrix, element at (0, 1) in the first...
View ArticleHow to pass command line arguments in Eclipse
Eclipse is one of the most preferred IDE for Java/JEE development. Eclipse IDE provides various options like running the application from the IDE, providing arguments to your Java program, debugging...
View ArticlePermGen Space Removal in Java 8
Though Java 8 introduced many new features to the Java language which are tangible in a way that you can see and use them like lambda expression and stream API. But there are other changes too which...
View ArticleHow to remove elements from an array - Java Program
Removing element from an array may look like a simple task but it comes with its own set of problems. Those problems stem from the fact that array in Java is fixed in length. Which means you can't just...
View ArticleReflection in Java
As per Wikipedia; in computer science, reflection is the ability of a computer program to examine, introspect, and modify its own structure and behavior at runtime.Thus the Reflection API in Java...
View ArticleReflection in Java - Class
For every type of object JVM creates an immutable instance of java.lang.Class which provides methods to examine the runtime properties of the object including its members and type information. Class...
View ArticleReflection in Java - Field
Reflection in Java class gives a good idea about how class is an entry point to all the Reflection APIs. Once you have Class object you can get information about members of the class fields,...
View ArticleReflection in Java - Method
Reflection in Java class gives a good idea about how class is an entry point to all the Reflection APIs. Once you have Class object you can get information about members of the class like fields,...
View ArticleReflection in Java - Constructor
Similar to reflection API for methods, there is also reflection API to get information about the constructors of a class. Using java.lang.reflect.Constructor you can get information about the...
View ArticleReflection in Java - Array
Array in Java is also a class so many of the methods in java.lang.Class may be used with the array. Refer reflection in java – class to know more about the methods in Class.Reflection in Java also...
View ArticleGenerating getters and setters using Reflection - Java Program
When you right click in any Java Bean class with in the eclipse IDE and click on Source – Generate Getters and Setters you get the getter and setter methods for the selected fields. Ever wondered what...
View ArticleInvoking getters and setters using Reflection - Java Program
In the post reflection in java – method it is already explained how you can invoke a method of the class at runtime even a private method. In this post we’ll use that knowledge to invoke getters and...
View ArticleHow to create immutable class in Java
Immutable class, as the name suggests, is a class whose object can’t be modified in anyway once created. Once an object of the immutable class is created and initialized the content of any field of...
View ArticleHow to convert Date to String in Java
In most of the Java application it’s a very common requirement to print date in a required format. For that you do need to convert date to a String that is in the required format. In this post we’ll...
View ArticleHow to convert String to Date in Java
When you are displaying date you will convert date to String in required format and print it. But you may need to convert it to date again if - You have to do any date calculation. You want to convert...
View ArticleJava Lambda Expressions Interview Questions
What is lambda expression?Lambda expression in itself is an anonymous method i.e. a method with no name which is used to provide implementation of the method defined by a functional interface.A new...
View ArticleHow to convert date and time between different time-zones in Java
You may come across a scenario where you need to convert date & time between different time zones.As example - In a flight application if you need to derive the arrival time of the flight in a...
View ArticleNew Date and Time API in Java 8
In Java 8 along with some new features like lambda expressions and stream API there is one more very important addition – A new Date and Time API which addresses the shortcomings of the old...
View Article