🚀 Day 2,3 of My Java Learning Journey These days I have explored the core fundamentals of Java and summarized them in simple, clear points. 🔹 Tokens in Java ⚡Identifiers: Names given to variables, classes, methods, and objects. They uniquely identify elements in the program.Examples: age, Student, calculateTotal(). ⚡Literals: Fixed values that never change during execution. Examples: 10, 3.14, 'A', "Java", true. ⚡Operators: Symbols used to perform actions like arithmetic, comparison, logical checks, or assigning values.Examples: +, -, >, <, &&, =. ⚡Separators: Symbols that structure Java code such as (), {}, [], ;, ,. They help define blocks, statements, parameters, and arrays. ⚡Comments: Non-executable notes that improve code readability. Types: // (single-line), /*…*/ (multi-line), /**…*/ (documentation). 🔹 Name Casing 🧩 PascalCase: Every word starts with a capital letter. Used for classes and interfaces.Example: StudentDetails. 🧩 camelCase: First word lowercase, next words start with uppercase. Used for variables and methods.Example: studentName, calculateTotal(). 🧩 snake_case: All lowercase with underscores. Rare in Java but common in databases.Example: employee_id. 🔹 Data Types in Java A data type defines what kind of data a variable can store and how much memory it uses. • Primitive Data Types (8 types) Store single values; fast and memory-efficient. Types: byte,short,int,long,float,double,char,boolean • Non-Primitive Data Types Reference types that store memory addresses and can grow in size. Examples: String, Arrays, Classes, Interfaces, Objects. 🔹 Variables in Java A variable is a memory location used to store values while the program runs. 🔸Local Variables: Declared inside methods or blocks.Exist only within that scope and have no default value. 🔸Instance Variables: Declared inside a class but outside methods.Each object gets its own copy, with default values based on the data type. Can be accessed with object reference. 🔸Static Variables: Declared inside the class and outside the method using static keyword. Shared by all objects of the class and initialized once in memory. Can be accessed by using class name. 🌱 These fundamentals explain Java's base and help in the creation of structured, readable, and effective programs. I'm eager to learn more! hashtag #Java hashtag #LearningJourney hashtag #ProgrammingBasics hashtag #TechSkills hashtag #CodeNewbie hashtag #SoftwareDevelopment Guided by: Levaku Lavanya mam, Saketh Kallepu sir, Uppugundla Sairam sir.
Java Fundamentals: Tokens, Name Casing, Data Types & Variables
More Relevant Posts
-
📘 Day 3 of My Java Learning Journey 🚀 Today, I learned about Java tokens, identifiers, literals, comments, and some basic commands & separators. Sharing my understanding..... 🔹 What are Tokens in Java? A token is the smallest unit in a Java program. Java tokens include: ▪️Keywords ▪️Identifiers ▪️Literals ▪️Comments ▪️Separators 🔹 Keywords Keywords are predefined words in Java. Each keyword has a specific meaning. Keywords are always written in lowercase. Examples: class, public, static, void, if, else, return, etc. 👉 Keywords cannot be used as identifiers. 🔹 Identifiers Identifiers are names used to identify variables, methods, classes, etc... Rules for Identifiers: 1.Should not start with a digit. 2.No spaces allowed. 3.Keywords are not allowed. 4.Special characters are not allowed except $ and _. ⭐Naming Conventions 💠PascalCase Used for class & interface names. Example: StudentDetails, EmployeeData. 💠CamelCase Used for variables & method names. Example: studentName, calculateSalary. 🔹 Literals A literal is a value assigned to a variable. Types of Literals in Java: 1️⃣ Number Literal – Numbers (0–9) 2️⃣ Character Literal – Single character enclosed with single quotes ' '. Example: 'A', 'b', '1' 3️⃣ Boolean Literal – true and false (lowercase only) 4️⃣ String Literal – Sequence of characters enclosed with double quotes " ". Example: "Java", "Learning". 🔹 Comments in Java Comments are used to explain code (not executed). Single-line comment → // Multi-line comment → /* */ 🔹 Basic Java Commands javac filename.java → Compile the code java ClassName → Execute the program cd → Change directory mkdir → Create folder cls → Clear screen 🔹 Separators in Java { } → Braces ( ) → Parentheses [ ] → Arrays ; → Statement termination , → Comma : → Colon #Java #LearningJourney #JavaDeveloper #ProgrammingBasics
To view or add a comment, sign in
-
🚀 Day 7 of My Java Learning Journey Today I learned about Operators in Java. 🔹 What is an Operator? An operator is a predefined symbol used to perform operations on operands (data/values). 🔹 Types of Operators 1️⃣ Based on Operands: Unary Operator → Works on one operand Example: ++, --, ! Binary Operator → Works on two operands Example: Arithmetic, Relational, Logical, Bitwise Ternary Operator → Works on three operands Example: condition ? trueValue : falseValue 2️⃣ Based on Task: Arithmetic Assignment Relational Conditional Logical Increment/Decrement Bitwise 🔹 Arithmetic Operators + - * / % 💡 In Java, + has two uses: Addition → 10 + 10 = 20 Concatenation → "Java" + 10 = "Java10" 🔹 Important Concept If + is used with numbers → Addition If + is used with a String → Concatenation Example: "demo" + "java" → "demojava" 10 + "java" → "10java" 🔹 Assignment Operators 1️⃣ Single Assignment Used to assign a value to a variable. int a = 10; 2️⃣ Compound Assignment Performs arithmetic operation and assigns result to the same variable. Examples: a += 5; // a = a + 5 a -= 5; // a = a - 5 a *= 5; // a = a * 5 a /= 5; // a = a / 5 a %= 5; // a = a % 5 🔹 Relational Operators Used to compare two values. Operators: > < >= <= == != ✔ Return type is always boolean (true/false). Example: 10 > 5 → true 10 == 5 → false 🔹 Conditional (Ternary) Operator Used to execute statements based on condition. Syntax: condition ? statement1 : statement2; Example: int result = (10 > 5) ? 1 : 0; 🔹 Logical Operators Used to check multiple conditions. 1️⃣ Logical AND (&&) ✔ True only if all conditions are true 2️⃣ Logical OR (||) ✔ True if any one condition is true 3️⃣ Logical NOT (!) ✔ Reverses the result Important: Logical operators always work with boolean values. 💡 Key Takeaways: • Assignment modifies values • Relational compares values • Logical checks conditions • Ternary simplifies if-else #Java #CodingJourney #JavaDeveloper #ProgrammingBasics
To view or add a comment, sign in
-
🚀 Day 1 of My Java Learning Journey Today, I explored some of the most important fundamentals of Java. Sharing my notes here to stay consistent and help others beginning their Java journey too! ☕💻 🔹History of Java: • James Gosling at Sun Microsystems developed Java in 1991, and it was made available to the public in 1995. • With the promise of "Write Once, Run Anywhere," it changed its name from Oak to Java. • Over the years, many improvements have transformed it into the leading language for corporate, mobile, and cloud applications. 🔹 Types of Programming Languages ⚡ Low-Level Languages: Work closely with hardware (machine and assembly). They are quick yet difficult to grasp since they work directly with memory and processor instructions. ⚡Middle-Level Languages: Provide a balance between hardware control and accessibility. C/C++ allows both system programming and application development. ⚡High-level languages: simple to read, write, and understand. Java, Python, and C# hide hardware details and focus on logic, which promotes productivity. 🔹 Java Execution Process • Java code is written in a .java file and compiled by javac into bytecode, which is platform-independent. • The Class Loader loads the bytecode into memory, preparing it for execution. • The Bytecode Verifier ensures the code is safe and follows JVM rules. • The JVM translates bytecode and converts it into machine code to produce the final result. • This entire flow makes Java truly Write Once, Run Anywhere. 🔹 Procedural-Oriented Programming (POP) • POP focuses on functions and procedures that operate on data. The program is divided into step-by-step instructions. • Data is usually not well-secured, as functions can access it freely. • It is simple and works well for small programs, but becomes harder to manage as projects grow. Examples: C, Pascal. 🔹 Object-Oriented Programming (OOP) • OOP focuses on objects that contain both data and methods, making the structure more organized. • It offers data security through concepts like encapsulation, inheritance, and polymorphism. • Easier to scale, maintain, and reuse code, especially for large applications. Examples: Java, Python, C++, C#. 🌱 These fundamentals explain Java's base and help in the creation of structured, readable, and effective programs. I'm eager to learn more! hashtag#Java hashtag#LearningJourney hashtag#ProgrammingBasics hashtag#TechSkills hashtag#CodeNewbie hashtag#SoftwareDevelopment Guided by: Levaku Lavanya mam, Saketh Kallepu sir, Uppugundla Sairam sir.
To view or add a comment, sign in
-
-
🚀 Day 10 | Learning Progress as a Java Full-Stack Developer Intern 🚀 Today, I learned about an important concept in Java called the Jagged Array. 🔹 What is a Jagged Array? A Jagged Array in Java is a multidimensional array where each row can have a different number of columns. Unlike a regular array, all rows do not need to have the same size. In simple terms, it is an array of arrays where each inner array can have different lengths. 🔹 Why Jagged Arrays are Used? ✅ When the number of columns is not fixed ✅ When memory needs to be used efficiently ✅ When data is uneven or irregular ✅ Helps save memory compared to fixed-size multidimensional arrays 🔹 Example of 2D Jagged Array in Java int[][] jagged = new int[3][]; jagged[0] = new int[2]; jagged[1] = new int[4]; jagged[2] = new int[3]; Here: Row 1 → 2 columns Row 2 → 4 columns Row 3 → 3 columns Each row has different size. 🔹 Example of 3D Jagged Array int[][][] jagged3D = new int[2][][]; jagged3D[0] = new int[2][]; jagged3D[1] = new int[3][]; This is useful when data structure is complex and uneven. 🔹 Key Features of Jagged Array • It is a multidimensional array • Each row can have different number of columns • Saves memory • Useful when size is unknown or varies • Can be 2D or 3D 🔹 Difference Between Array and Jagged Array ArrayJagged ArrayStores homogeneous dataStores homogeneous dataFixed sizeVariable row sizesCannot grow or shrinkRows can have different lengthsRequires continuous memoryMemory allocated dynamicallyAll rows same length (2D array)Rows can have different lengthsLess memory efficient in uneven dataMore memory efficient 🔹 Example Difference Normal 2D Array: int[][] arr = new int[3][3]; Jagged Array: int[][] jagged = new int[3][]; jagged[0] = new int[2]; jagged[1] = new int[5]; jagged[2] = new int[3]; TAP Academy Sharath R #Java #FullStackDeveloper #JavaLearning #Programming #Internship #CodingJourney #SoftwareDevelopment #FutureDeveloper
To view or add a comment, sign in
-
-
🚀 Day 7 | Core Java Learning Journey 📌 Topic: Arrays in Java Today, I learned about Arrays in Core Java, one of the most important data structures used to store multiple values efficiently using a single variable. 🔹 What is an Array? An array is a data structure that stores multiple values of the same data type in contiguous memory locations, allowing fast access using index values. 🔹 Advantages of Arrays ✅ Helps in code optimization by reducing multiple variable declarations ✅ Provides fast data access using index ✅ Improves performance due to contiguous memory allocation ✅ Useful for handling large amounts of similar data 🔹 Disadvantages of Arrays ❌ Fixed size (cannot be resized dynamically) ❌ Memory wastage if allocated size is not fully utilized ❌ Stores only homogeneous data ❌ Insertion and deletion operations are costly 🔹 Types of Arrays in Java 1️⃣ One-Dimensional Array Used to store elements in a linear form. Syntax : int a[ ] = new int[size]; 2️⃣ Two-Dimensional Array Stores data in rows and columns (matrix form). Syntax: int a[ ][ ] = new int[rows][columns]; 3️⃣ 3D Array Used to store data in three dimensions, useful for complex data representation. Syntax : int a[ ][ ][ ] = new int[x][y][z]; 4️⃣ Jagged Array An array of arrays where each row can have a different size. Syntax : int a[ ][ ] = new int[rows][ ]; 📌 Key Learning: Arrays help in writing cleaner, optimized, and efficient code and form the foundation of advanced data structures. A special thanks to Vaibhav Barde Sir for his clear explanations and consistent support throughout the learning process. Looking forward to learning more Core Java concepts ahead! 💻✨ #CoreJava #JavaDeveloper #BackendEngineering #SoftwareDeveloper #ComputerScienceGraduate #ProgrammingLife #TechLearning #JavaConcepts
To view or add a comment, sign in
-
-
🚀 Day 10 at Tap Academy – Understanding Pass-by-Value & Pass-by-Reference in Java ☕💻 💫Today’s concept explains how data is passed between variables and methods. This is very important to understand how Java handles memory and objects. 🔹 Pass-by-Value 📌 Definition: Pass-by-value means the actual value of a variable is copied and passed to another variable or method. There is no connection between them. 👉 If one value changes, the other value does not change. 📦 Example: public class PassByValueExample { public static void main(String[] args) { int a = 10; int b = a; // value copied b = 20; // changing b System.out.println("Value of a: " + a); // 10 (no change) System.out.println("Value of b: " + b); // 20 } } ✅ Explanation: a and b store separate values Changing b does NOT affect a 🔹 Pass-by-Reference 📌 Definition: Reference means address of the object. Pass-by-reference means two reference variables point to the same object in memory. 👉 If changes are made using one reference, it affects the original object. 👉 One object can have multiple references. 📦 Example: class Student { int marks; } public class PassByReferenceExample { public static void main(String[] args) { Student s1 = new Student(); s1.marks = 80; Student s2 = s1; // reference copied (same address) s2.marks = 95; // change using s2 System.out.println("Marks using s1: " + s1.marks); // 95 System.out.println("Marks using s2: " + s2.marks); // 95 } } ✅ Explanation: s1 and s2 refer to the same object Changing through one reference affects both 🎯 Simple Summary 📦 Pass-by-Value → Copy of value → No effect on original 📍 Pass-by-Reference → Same address → Changes affect original object Understanding this helps in writing better programs and managing memory efficiently. ✨ Learning step-by-step, building strong programming fundamentals! #TapAcademy #Java #CoreJava #LearningJourney #ProgrammingBasics #JavaDeveloper #CodingConcepts #PassByValue #PassByReference
To view or add a comment, sign in
-
-
🚀Day 4(Part 3) | core java learning journey ☕ 📘 Topic: Operators in Java Today I learned about Operators in Java, which are used to perform different types of operations on variables and values. Operators play a very important role in writing logic, conditions, and calculations in Java programs. 🔹 1. Unary Operators Unary operators work on a single operand. Examples: +, -, ++, --, ! They are mainly used to increment, decrement, or negate values. 🔹 2. Arithmetic Operators Used to perform mathematical calculations. Examples: +, -, *, /, % These operators are commonly used for addition, subtraction, multiplication, division, and modulus operations. 🔹 3. Relational Operators Used to compare two values and return a boolean result (true or false). Examples: ==, !=, >, <, >=, <= They are mostly used in decision-making statements like if and while. 🔹 4. Logical Operators Used to combine multiple conditions. Examples: && (AND), || (OR), ! (NOT) These operators are very helpful in complex conditional expressions. 🔹 5. Bitwise Operators Operate on bits and perform bit-by-bit operations. Examples: &, |, ^, ~ They are mainly used in low-level programming and performance optimization. 🔹 6. Assignment Operators Used to assign values to variables. Examples: =, +=, -=, *=, /= They help in updating variable values efficiently. 🔹 7. Shift Operators Used to shift bits to the left or right. Examples: <<, >>, >>> These operators are useful for fast calculations and bit manipulation. 🔹 8. Ternary Operator A shorthand way to write conditional statements. 🙏 Grateful to my mentor: Vaibhav Barde Sir for continuous guidance and support. #CoreJava #JavaOperators #JavaLearning #ProgrammingBasics #CodingJourney #FortuneCloud
To view or add a comment, sign in
-
-
🚀Day 48–50: Java Full Stack Learning with Frontlines EduTech (FLM)& Fayaz S. In these sessions, I explored Java 8 Stream API features, Method References, Optional, and Date-Time. 🔹 partitioningBy() partitioningBy() splits elements into two groups based on a given predicate (true/false condition). It returns a Map<Boolean, List<T>>, making it useful for separating data like even/odd or passed/failed records. Map<Boolean, List<Integer>> result = numbers.stream() .collect(Collectors.partitioningBy(n -> n % 2 == 0)); 🔹 reduce() reduce() combines stream elements into a single result such as sum, product, or concatenation. int sum = numbers.stream() .reduce(0, (a, b) -> a + b); 🔹 joining() joining() is used to concatenate stream elements into a single String. It allows adding delimiters, prefixes, and suffixes while combining values. String names = list.stream() .collect(Collectors.joining(", ")); 🔹 groupingBy() groupingBy() groups elements based on a classification function. It returns a Map<Key, List<Value>>, commonly used in real-world scenarios like grouping employees by department. Map<String, List<Employee>> grouped = employees.stream() .collect(Collectors.groupingBy(Employee::getDepartment)); 🔹Method References (::) Method references provide a cleaner and shorter syntax for lambda expressions when only calling an existing method. They improve readability and reduce boilerplate code but can only be used when the lambda body contains a single method call. ✔ Static Method → ClassName::methodName ✔ Instance Method → object::methodName ✔ Instance Method → ClassName::methodName (e.g., String::toUpperCase) ✔ Constructor Reference → ClassName::new list.stream() .map(String::toUpperCase) .forEach(System.out::println); 🔹 Optional (Java 8) Optional helps avoid NullPointerException by handling possible null values safely. Optional<String> name = Optional.ofNullable(value); 🔹 LocalDateTime LocalDate and LocalDateTime are part of the java.time package introduced in Java 8. LocalDate represents only date (year, month, day) while LocalDateTime represents both date and time without timezone information. Both classes are immutable and inherently thread-safe. LocalDate date = LocalDate.now(); LocalDateTime dateTime = LocalDateTime.now(); LocalDate nextWeek = date.plusWeeks(1); LocalDateTime updatedTime = dateTime.minusHours(2); 💡 Overall, I strengthened my understanding of functional programming concepts, Stream processing, method referencing, null-safety using Optional, and Date-Time handling in Java. 🚀📈 #Java #JavaFeatures #JavaFullStack #FrontlinesEduTech #FullStackDeveloper #JavaDeveloper
To view or add a comment, sign in
-
#Tapacademy Continuing My Core Java Learning Journey at Tap Academy — Understanding Data Types & Memory Basics Today’s session started with something very fundamental — how data is actually stored inside a computer before we even learn Java data types. -How data is stored in any device? Before understanding Java data types, we explored how computers handle information internally: - Data is temporarily stored in RAM (Random Access Memory) during program execution. - RAM consists of many bytes. 1 byte = 8 bits. Each bit represents an electronic state (low/high voltage), which is technically represented as 0 and 1. Computers understand only binary (0s and 1s), not real-world values like numbers, characters, or decimals directly. That’s where Data Types come in. --- What are Data Types in Java? Data types define: - What type of data a variable can store - How much memory is allocated - The range of values allowed - How Java converts real-world data into binary form In simple terms: -- Data types act as translators between human-understandable data and machine-level binary data. --- Primitive Data Types in Java 1. byte - Size: 1 byte (8 bits) - Range: -128 to 127 - Example: byte age = 25; 2. short - Size: 2 bytes - Range: -32,768 to 32,767 short num = 2000; 3. int - Size: 4 bytes - Commonly used integer type int salary = 50000; 4. long - Size: 8 bytes long population = 8000000000L; 5. float - Size: 4 bytes (decimal numbers) float price = 19.99f; - by default the decimal numbers are double in java so use suffix 'f' to make it float 6. double - Size: 8 bytes (higher precision decimal) double pi = 3.14159; 7. char - Size: 2 bytes (stores single character using Unicode) char grade = 'A'; 🔹 8. boolean - Stores true or false boolean isJavaFun = true; --- Formula for Range of Data Types For an n-bit signed data type: - Minimum value = -2^(n-1) - Maximum value = 2^(n-1) - 1 Example: For byte (8 bits): Minimum = -2⁷ = -128 Maximum = 2⁷ - 1 = 127 --- Key Takeaway Understanding memory and data types helps us write efficient programs because: - We choose correct memory size - Improve performance - Prevent overflow errors - Understand how Java interacts with hardware internally Step by step, building strong Java fundamentals! 🔥 #JavaLearning #CoreJava #ProgrammingJourney #TapAcademy #JavaBasics #CodingLife
To view or add a comment, sign in
-
-
🚀 Day 13 TAP Academy | Understanding Methods in Java 💡 What is a Method? A method is a group of statements that together perform an operation. Methods help make programs modular, clean, and easy to maintain. Think of a method as a mini-program inside your main program — you define it once and call it whenever needed. 🧠 Syntax of a Method: returnType methodName(parameters) { // Method body // Code to perform the task } ✅ Example: public int add(int a, int b) { return a + b; } Here: public → Access modifier int → Return type add → Method name (int a, int b) → Parameters return a + b; → Method body 🔹 Why Methods Are Important ✔️ Eliminate code repetition ✔️ Increase code reusability ✔️ Simplify debugging and testing ✔️ Improve program readability and structure 🔸 Types of Methods in Java Java provides different types of methods based on their behavior and purpose 👇 🧩 1️⃣ Predefined (Built-in) Methods These are already defined in Java’s standard libraries. You just have to use them. ✅ Example: System.out.println("Hello Java!"); Math.sqrt(25); // returns 5.0 📚 These methods come from predefined classes like Math, String, System, etc. 🧱 2️⃣ User-defined Methods These are created by the programmer to perform specific tasks. ✅ Example: public class Calculator { void greet() { System.out.println("Welcome to TAP Academy!"); } int add(int a, int b) { return a + b; } public static void main(String[] args) { Calculator obj = new Calculator(); obj.greet(); System.out.println("Sum: " + obj.add(5, 10)); } } ✅ Output: Welcome to TAP Academy! Sum: 15 ⚙️ Based on Return Type TypeDescriptionExampleVoid MethodDoes not return any valuevoid greet() {}Return Type MethodReturns a value after executionint add() { return a+b; } 🧠 Based on Parameters TypeDescriptionExampleWithout ParametersDoesn’t accept any inputvoid display()With ParametersTakes input valuesvoid add(int a, int b) 🔁 Method Overloading When multiple methods have the same name but different parameters, it’s called method overloading. It increases code flexibility and reusability. ✅ Example: void show() { System.out.println("No Parameters"); } void show(int a) { System.out.println("Value: " + a); } 🧩 Difference Between Built-in and User-defined Methods FeatureBuilt-in MethodsUser-defined MethodsDefined byJava LibraryProgrammerPurposeCommon operationsSpecific tasksExamplesMath.pow(), System.out.println()add(), display() #TAPAcademy #JavaProgramming #Methods #LearningJourney #InternshipExperience #JavaDeveloper #CodingJourney #ProgrammingBasics #TechLearning #LearnToCode #CodeWithJava #SoftwareDevelopment #CodingCommunity #BuildInPublic #JavaConcepts #MethodOverloading
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development