Posts

Showing posts from May, 2024

10. String and Operators.

Image
 String Strings in Java are a crucial aspect of programming, as they allow for the manipulation and handling of text. Here’s a detailed explanation of strings, their characteristics, and how they can be created and used in Java. Characteristics of Strings in Java String Class : String is a predefined class in Java, derived from the java.Lang package. It is a non-primitive data type because it is a class. A String is a collection of characters enclosed within double quotes ( " " ). Immutability : Strings in Java are immutable, meaning once a String object is created, its value cannot be changed. Creating Strings in Java There are two main ways to create a string in Java:        1.  Using String Literals : When a string is created using string literals, it is stored in the String Constant Pool (SCP)                                            ...

9. Variable types And Characteristics .

 Variable Types 1) Global Variable - Global Variable are declared in class block are known as Global Variable. They are classified as 2 types : -                                              1) static Variable                                              2) Non-Static Variable 2) Local Variable - The Variable which are declared in method block inside method block expect class block called as local variable. Characteristic of local variable -  1)  Variable declared inside a block remain accessible to that block only cannot accessible from outside the block. If we accessed it from outside block,  it will get compile time error.  ex - class example           {                ...

8. Datatype and Variable

Image
Datatype It is a container where we create variable to store data. There are two types of datatypes :- 1) Primitive Datatype :- Primitive datatype helps the programmer to create primitive type variables which helps us to store primitive data. 2) Non-Primitive Datatype :-  Unlike primitive data types, these are not predefined. These are user-defined data types created by programmers. These data types are used to store multiple values. There are five types of non-primitive data types in Java. They are as follows: Class Object String Array Interface Variable Variables are the container where we store data in java we create variable with the help of datatypes. [Note - In java we cannot use a variable without declaring.] Syntax - Datatype variablename ;                byte age ; Variable Initialization statement :-  Assigning value to create variable is known as variable initializing statement. ex - age = 10 ; grade = '*' ; salary = 5.00.0...

7. Tokens and Industry Standards.

Image
 Tokens  Tokens are the smallest unit of java programming language. They are classified into two types: - 1) Keyword's 2) Identifiers  let's learn them in detail....... 1.  Keywords  - The words which are aware by the compiler are known as keywords.  - They have pre-defined meaning, and we cannot alter (change) them.  - There are 50+ keywords in java.  -  Every keyword must be written in lower case. The below table is the list for keywords.    2.  Identifier    Identifiers are names given by the programmer to various elements in a Java program.  These elements can include classes, interfaces, variables, methods, packages, Enums, and more.   Examples of identifier 1)   Class Names: 'class MyClass { ... }' 2)   Interface Names: 'interface MyInterface { ... }' 3)   Variable Names: 'int myVariable = 10;' 4)    Method Names: 'public void myMethod() { ... }' 5)  ...

6. Basic Commands for command prompt and Basic java program

Command Line Interface Commands for Using Command Prompt - Here are some common commands used in the Command Prompt: 'dir' Lists the contents of the current directory. Example: ' dir' 'cls' Clears the screen. Example: ' cls' 'cd' Changes the directory from the current folder to a specified folder. Example: ' cd foldername' 'cd..' Moves up one directory level from the current folder to the parent folder. Example: ' cd..' 'drive name:' Changes the drive. Example: '  C:' 'mkdir' or ' md' Creates a new folder in the current directory. Example: ' mkdir foldername' or ' md foldername' 'javac -version' Checks the version of the Java compiler. Example: ' javac -version' 'java -version' Checks the version of the Java Virtual Machine (JVM). Example: ' java -version' These commands will help you navigate and manage directories, check Java versions, and ...

5. Levels of Language

Image
  Programming languages are categorized into three levels: Low-Level Language                                                                                                           Mid-Level Language                                                                                                             High-Level Language Let's learn about each level one by one: 1) Low-Level Language A low-level language is directly understandable by a comp...