Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package nik;
- import java.util.*;
- class encaps{
- private int n;
- private String l;
- public String getword()
- {
- if (l==("[a-zA-z]+")) {
- System.out.println("All String");
- }
- else if (l==("[0-9}]+")){
- System.out.println("All integers");
- }
- else if (l==("[a-zA-Z - 0-9]+")){
- System.out.println("Combinatio of String and Integer");
- }
- return l;
- }
- public int getnumber(){
- return n;
- }
- public void setnumber (int newnumber){
- n=newnumber;
- }
- public void setword (String newword){
- l= newword;
- }
- }
- public class Nik {
- public static void main(String[] args) {
- Scanner s= new Scanner(System.in);
- System.out.println( "type here; ");
- String input = s.nextLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement