Category: Java

JAVA New Features – Lambda Expressions, Functional Interfaces

This Blog explains about Java 8 – New Features – Lambda Expressions, Functional Interfaces. Lambda Expressions: WHY: Functional Programming WHAT: Anonymous Functions: Closures Function – Method: HOW: Eg: 1 1) Remove Method Name 2) Remove return datatype 3) Remove Access Modifiers if any. 4) Add -> in between () and {} Eg. 2: Eg. 3: […]

Read More

Access Modifiers or Access Specifiers

In Java, access modifiers are keywords used to define the accessibility or visibility of classes, variables, methods, and constructors. There are four types of access modifiers in Java: 1. public: The public access modifier in Java is used to declare that a class, variable, method, or constructor is accessible from anywhere in the program, both […]

Read More

static vs non static java

Image referred from: http://www.sitesbay.com/java/images/basic-java/Static-and%20non-Static-Method-rules.png static: In Java, the ‘static’ keyword is used to declare members (variables and methods) that belong to the class itself, rather than to individual instances of the class. When a member is declared as ‘static’, it means that it is shared among all instances of the class. This allows you to […]

Read More

Data types in Java

Before we discuss Java data types, programming languages categorized into two types there are, Image referred from: https://nosleepjavascript.com/javascript-is-best/ Statically typed programming languages Statically typed languages require variables must first be declared before they can be used that are checked at compile-time. Examples of statically typed languages include Java, C, C++, and Swift. In these languages, […]

Read More