Java Variables

Java Variables In Hindi – Variables In Java In Hindi

Java

Java Variables In HindiVariables In Java In Hindi – Java Variable jab create kiya jata hai tab interpreter dauvara value ko store karne ke liye memory location assign ki jati hai |

Also Read – Java Comments And Java Syntax

Variables In Java In Hindi

Java Main Data Ko Store Karne Ke Liye Variables Ka Istemal Kiya Jata Hai Or Java Variables Ek Tarah Ka Containers Hota Hain Jo Data Ko Information Ke Rup Main Store Karte Hain |

Java Variable Par Koi Bhi data type ki value store ki ja sakti hai | Example : Number , String, int , float ,Char etc |

Yadi Aapne  HTML Full Course  And CSS Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

Java Mai Koi Types Ke Variables Hote Hai Jinhe Niche Ek Ek Point Mai Understand Kiya Gaya Hain |

  • String – stores text, Like “Hello”. String values Ko double quotes Duwara Close Kiya Jata Hai |
  • int – stores integers (whole numbers), without decimals, Like 123 or -123
  • float – stores floating point numbers, with decimals, Like 19.99 or -19.99
  • char – stores single characters, such as ‘a’ or ‘B’. Char values are surrounded by single quotes
  • boolean – stores values with two states: true or false

Waise Upper Diye Gaye Variables Par Ek Alag Se Article Bana Hai Jinhe Data Types Kahte Hai Aap Inhe A to Z Understand Kar Sakte Hai |

Declaring (Creating) Variables In Java

Java Mai Variables Ko Create karne Ke Liye Aapko Type And Variables Name And Value Assign Ki Jati Hai |

Syntax:

type variable_name = value;
  • type – Type Means String , Int Etc
  • variable_name – Aap Variable De Sakte Hai |
  • value – Aap Type Variable Ke Anushar Value De Sakte Hai |

Assigning Value To Variable in Java Hindi

Jab Ham Variable Create Karte hai Java me to sabse pahle hame ye batana hota hai ki ham kis Data type ki value assign karni hai |

Example_1:

public class Myclass
{
	public static void main(String[] args) {
	    String fname = "Danish";
		System.out.println("Your Name Is :" + fname);
	}
}

Output:

Your Name Is : Danish

Example_2:

public class Myclass
{
	public static void main(String[] args) {
	    String fname = "Danish";
       	String lname = " Ali";
        String Full_Name = fname + lname ;
		System.out.println("Your Name Is :" + Full_Name);
	}
}

Output:

Your Name Is :Danish Ali

Example_3:

public class Myclass
{
	public static void main(String[] args) {
	    int x = 10;
        int y = 5;
		System.out.println(x + y);
	}
}

Output:

15

Changing Variable’s Value in Java hindi

Java Language me variable ki value change ya re-assign ki ja sakti hai |

Also Read – What is Java in Hindi

Example :

public class Myclass {
  public static void main(String[] args) {
	    String fname = "Danish";
		System.out.println("Your Name Is :" + fname);
        fname = "Ali";
        System.out.println("Your Name Is :" + fname);
    
  }
}

Output:

Your Name Is :Danish
Your Name Is :Ali

Declare Many Variables in Java in Hindi

Agar Ham Same Data Types Ke Variables Ek Jyada Create Karna Chahte Hai To Aap Ek Hi Line Mai Alag Alag Variables Create kar Sakte Hain |

Example:

public class Myclass
{
	public static void main(String[] args) {
	    int x = 10 , y = 5 , z = 25;
		System.out.println(x + y + z);
	}
}

Output:

40

Java Identifiers in Hindi

Java Mai Variables Ko Ek Unique Tarah Se Create Kiya Jata Hai Jaise Agar Aap minutesPerHour And secondPerMinutes Variables Create kar Rahe To Aap In Example Ke Sath Understand Kar Sakte Hain |

Example:

int minutesPerHour = 60;
int secondPerMinutes = 60;

// OK, but not so easy to understand what m actually is
int m = 60;

Types of Variables In Java In Hindi

Variables In Java Hindi – Java Programming me variable ke two type hote hai|

  • 1 . Local Variables
  • 2 . Global Variables

1 . Local Variables

Local Variables, functions ke under hote hai| unki visibility sirf function ke under hoti hai, jab wo function ke bahar aate hai tab destroy ho jate hai| Isse Ham Or Accha Samanjh ne kiye Iska Ek Example Dekhte Hai |

2. Global Variables

Global Variables , function ke bahar hote hai | unki visibility function ke under or bahar hoti hai| unka scope pure program par hota hai |

Friends Mujhe Umeed Hai Ki Aapko Variables in Hindi Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |

Yadi Aapne  HTML Full Course  And CSS Full Course And Python Full Course And PHP Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *