Posts

Showing posts with the label Data Type

Variable

 package data_types; public class Data_Types { public static void main(String[] args) { byte x = 2; System.out.println(x); int age = 10; System.out.println(age); float rate_of_intrest = 2.3f; System.out.println(rate_of_intrest); double rate = 3.1428571; System.out.println(rate); boolean isThisSeriesofcodes = false; System.out.println(isThisSeriesofcodes); char myCharacter = '@'; System.out.println(myCharacter); } }

Data Type

package DataTypes; public class DataTypeTutorial { public static void main(String[] args) { byte x = 2; int age = 10; float rateOfIntrest = 2.3f; //r should be always small and only one word can be assigned //value dene ke baad f likhna zaruri hai double rate = 3.1428571; boolean isThisSeriesIsCool = false; //sirf true ya false he deta hai char myCharacter = 'a'; /*   Kisi be type ke character ko print ker sakta hai lekin sirf 1 character   @ ya ese ksi bhi charecter bhi included hai */ System.out.println(myCharacter); } }