SHARE
TWEET

Untitled

a guest Jul 17th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package nik;
  7. import java.util.*;
  8. class encaps{
  9.     private int n;
  10.     private String l;
  11.    
  12.     public String getword()
  13.     {
  14.         if (l==("[a-zA-z]+")) {
  15.         System.out.println("All String");
  16.         }
  17.         else if (l==("[0-9}]+")){
  18.         System.out.println("All integers");
  19.         }
  20.         else if (l==("[a-zA-Z - 0-9]+")){
  21.         System.out.println("Combinatio of String and Integer");
  22.         }
  23.         return l;
  24.     }
  25.     public int getnumber(){
  26.         return n;
  27.     }
  28.     public void setnumber (int newnumber){
  29.         n=newnumber;
  30.     }
  31.     public void setword (String newword){
  32.         l= newword;
  33.     }
  34.            
  35. }
  36. public class Nik {
  37.  public static void main(String[] args) {
  38.         Scanner s= new Scanner(System.in);
  39.         System.out.println( "type here; ");
  40.         String input = s.nextLine();
  41.        
  42. }  
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top