Output:
Click Here For Java Online Compiler
Solution:
*** Class And Object Example *** Country Information:Name: PakistanProvinces: 4 Population(m): 193.2
Click Here For Java Online Compiler
Solution:
/** * * @author Alee Ahmed Kolachi */ class Country { String name; int provinces; float population; public static void main(String[] args) { Country country1 = new Country(); country1.name = "Pakistan"; country1.provinces = 4; country1.population = 193.2f; //in millions System.out.println("*** Class And Object Example ***" + "\n"); System.out.println("Country Information: "); System.out.println("Name: " + country1.name); System.out.println("Provinces: " + country1.provinces); System.out.println("Population(m): " + country1.population); } }
comment 1 comments:
more_vertNice post with nice blog
5 February 2018 at 02:08sentiment_satisfied Emoticon