Java Data type

                       Rajeev Ranjan Tiwari


Java Data Types

As explained in the previous chapter, a variable in Java must be a specified data type:

(1)

public class MyClass { 

public static void main(String[] args) 

{ int myNum = 5; // integer (whole number)

 float myFloatNum = 5.99f; // floating point number 

char myLetter = 'D'; // character 

boolean myBool = true; // boolean 

String myText = "Hello"; // String 

System.out.println(myNum); 

System.out.println(myFloatNum); 

System.out.println(myLetter); 

System.out.println(myBool); 

System.out.println(myText); } } 

(2)

public class MyClass { 

public static void main(String[] args) { 

byte myNum = 100; 

System.out.println(myNum); } } 

(3)

public class MyClass {

 public static void main(String[] args) {

 short myNum = 5000; 

System.out.println(myNum); } }

(4)

public class MyClass {

 public static void main(String[] args) {

 int myNum = 100000; 

System.out.println(myNum); } } 

(5)

public class MyClass {

 public static void main(String[] args) {

 long myNum = 15000000000L; 

System.out.println(myNum); } } 

(6)

public class MyClass { 
public static void main(String[] args) { float myNum = 5.75f; System.out.println(myNum); } } 

(7)
public class MyClass { 
public static void main(String[] args) { double myNum = 19.99d; System.out.println(myNum); } } 

(8)
public class MyClass {
 public static void main(String[] args) { float f1 = 35e3f; double d1 = 12E4d; System.out.println(f1); System.out.println(d1); } } 

अंत मे अगर इस पोस्ट से आपको कुछ फायदा हुवा हो तो इसे दुसरो के साथ भी share करे ताकी दुसरो का भी फायदा हो. इस पोस्ट को पूरा पढ़ने के लिए आपका धन्यवाद और बहुत शुक्रिया.
Thanks friend posted by Rajeev Ranjan Tiwari

Comments

  1. Sir ji core fax kya hota hai

    ReplyDelete
  2. Coral ka article dalo sir ji

    ReplyDelete
  3. Sir Slider ka kuchh likho na code

    ReplyDelete
  4. Adorable sir ji . Kaese ho aap

    ReplyDelete
  5. Good sir auto cad me extend ka code kaese likha jata hai

    ReplyDelete
  6. Good bro article ke kuchh word me advance code kafi hai sir thoda kam code dalo sir

    ReplyDelete
  7. Jabardast sahab kya baat hai nice ji

    ReplyDelete
  8. Good Bhai aapka article bahut good hai aese hi likhate rho aap

    ReplyDelete
  9. Sir good article aese hi dalo har din

    ReplyDelete
  10. Sir account ka bhi dalte ho aap

    ReplyDelete
  11. Aapka article bahut helpful hai . Sir design ka knowledge hai aapko kya

    ReplyDelete

Post a Comment

Popular posts from this blog

OT Technician

D Pharma

Tor Browser