Posts

Showing posts with the label java

Java Static Final Variable | Core Java Bangla Tutorial #shorts #java #viral

Image

Java Instance Final Variable | Core Java Bangla Tutorial #shorts #java #...

Image

Literals in Java Explained in Bangla | Learn Java Step by Step | Core Java

Image
Literals in Java Explained in Bangla | Integer, Float, Char, String, Boolean & Null | Java Tutorial বাংলা Literals in Java Explained in Bangla | Integer, Float, Char, String, Boolean & Null Literal হলো Java প্রোগ্রামে ব্যবহৃত একটি স্থির মান (Fixed Value) - যা সরাসরি কোডে লিখি বা কোনো variable এ assign করি। অর্থাৎ, Literal মানে এমন একটি constant value যা runtime-এ পরিবর্তিত হয় না। int a = 10; // 10 is a literal char ch = 'A'; // 'A' is a literal 🔹 এখানে 10 এবং 'A' — দুটোই literal, কারণ এগুলো fixed মান যা সরাসরি কোডে লেখা হয়েছে। 🔢 Types of Literals in Java Java-তে মোট ৬ ধরনের Literal আছে: Integer Literals Floating-Point Literals Character Literals String Literals Boolean Literals Null Literal 1️⃣ Integer Literals Integer Literal হলো পূর্ণসংখ্যা — যেখানে কোনো fraction থাকে না। int a = 10; // Decimal (base 10) int b = 010; // Octal (base 8) int c ...

Keywords in Java (Reserved Words) Explained with Examples – Core Java Tutorial

Image
Keywords in Java (Reserved Words) Explained with Examples | Core Java Tutorial Keywords in Java (Reserved Words) Explained with Examples Learn Java — a complete guide to understanding Java keywords , their importance, rules, and usage with real examples. What are Keywords in Java? In Java, keywords are predefined, reserved words that have a special meaning to the Java compiler. These words are part of the Java syntax and cannot be used as identifiers (like variable or class names). int class = 10; // ❌ Invalid: 'class' is a keyword int number = 10; // ✅ Valid identifier For example, class , if , for , and return are Java keywords that define how the code should behave. Why Java Keywords Are Reserved Java keywords are reserved to maintain consistency in the language structure. Each keyword has a predefined role, and using them for variable or method names would create confusion for the compiler. if – used for conditional statements class...

এনক্যাপসুলেশন (Encapsulation) Object-Oriented Programming

- Encapsulation হলো Object-Oriented Programming এর একটা গুরুত্বপূর্ণ concept। এটার মাধ্যমে class-এর data গুলোকে বাইরের access থেকে লুকানো হয়। যেমন – variable গুলোকে private রাখা হয়। তারপর সেই data access করার জন্য ব্যবহার করা হয় Getter আর Setter method। এর ফলে data হয় secure, code হয় easy to maintain, আর system পায় flexibility।   public class Employee {    private String name;    public String getName() {     return name;   }    public void setName(String name) {     this.name = name;   }  }   public class EmployeeMain {    public static void main(String[] args) {     Employee employee = new Employee();     employee.setName("Abdullah");     System.out.println("Name: "+ employee.getName());   }  } output: Abdullah