- import java.util.*;
- public class Main {
- public static void main(String[] args){
- //fill the code here
- Scanner sc= new Scanner(System.in);
- System.out.println("Enter the country name");
- String s=sc.nextLine();
- System.out.println("Enter the country code");
- String c=sc.nextLine();
- System.out.println("Enter the isd code");
- String n=sc.nextLine();
- // Country co=new Country(s,c,n);
- // System.out.println("Country Name : "+co.getCountry());
- // System.out.println("Country Code : "+co.getCode());
- // System.out.println("ISD Code : "+co.getNum());
- }
- }
- //country
- public class Country
- {
- // Instance Variables
- String cou;
- String code;
- String num;
- // Constructor Declaration of Class
- public Country(String cou, String code,String num)
- {
- this.cou = cou;
- this.code= code;
- this.num= num;
- }
- // method 1
- public String getCountry()
- {
- return cou;
- }
- public String getCode()
- {
- return code;
- }
- public String getNum()
- {
- return num;
- }
- }
[text] aa6
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: