কম্পিউটার

জাভাতে একটি প্রদত্ত অক্ষরের জন্য ইউনিকোড বিভাগটি কীভাবে খুঁজে পাবেন?


একটি চরিত্র ক্লাস হল একটি বস্তুর একটি সাবক্লাস এবং এটি একটি অবজেক্টে প্রাইমিটিভ টাইপ char এর একটি মান মোড়ানো হয়। অক্ষরের প্রকারের একটি বস্তুতে একটি একক ক্ষেত্র রয়েছে যার ধরন হল char . আমরা getType() ব্যবহার করে একটি নির্দিষ্ট অক্ষরের জন্য ইউনিকোড বিভাগ নির্ধারণ করতে পারি পদ্ধতি এটি চরিত্রের একটি স্থির পদ্ধতি ক্লাস এবং এটি একটি পূর্ণসংখ্যা প্রদান করে char ch এর মান ইউনিকোড সাধারণ বিভাগে প্রতিনিধিত্ব করে।

সিনট্যাক্স

public static int getType(char ch)

উদাহরণ

public class CharacterTypeTest {
   public static void main(String args[]) {
      System.out.println("T represnts unicode category of: " + Character.getType('T'));
      System.out.println("@ represnts unicode category of: " + Character.getType('@'));
      System.out.println(") represnts unicode category of: " + Character.getType(')'));
      System.out.println("1 represnts unicode category of: " + Character.getType('1'));
      System.out.println("- represnts unicode category of: " + Character.getType('-'));
      System.out.println("_ represnts unicode category of: " + Character.getType('_'));
      System.out.println("a represnts unicode category of: " + Character.getType('a'));
   }
}

আউটপুট

T represnts unicode category of: 1
@ represnts unicode category of: 24
) represnts unicode category of: 22
1 represnts unicode category of: 9
- represnts unicode category of: 20
_ represnts unicode category of: 23
a represnts unicode category of: 2

  1. জাভাতে প্রদত্ত স্ট্রিং থেকে এইচটিএমএল ট্যাগগুলি কীভাবে সরিয়ে ফেলা যায়?

  2. একটি প্রদত্ত অক্ষর জাভাতে একটি সংখ্যা/অক্ষর কিনা তা কীভাবে পরীক্ষা করবেন?

  3. কিভাবে আমরা জাভাতে একটি JPasswordField এর প্রতিধ্বনি অক্ষর দেখাতে/লুকাতে পারি?

  4. Windows 10 বা Windows 11 এর জন্য প্রোডাক্ট কী কীভাবে খুঁজে পাবেন