Advertisement
Sabbir-bin

if condition

Jun 17th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main{
  3.     static Scanner myScanner= new Scanner(System.in);
  4.     public static void main(String[] args) {
  5.         String myname;
  6.     myname=new String("Sabbir Ahmed");
  7.     System.out.println(myname);
  8.     System.out.println("MY name length is = "+myname.length()+".");
  9.     if (myname.length()>14){
  10.         System.out.println("Your name is too long.");
  11.        
  12.     }
  13.     else if(myname.length()<3){
  14.         System.out.println("Your name is too short");
  15.     }
  16.     else{
  17.         System.out.print("Perfect! "+myname+".");
  18.     }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement