چند روش برای ایجاد String در جاوا

we can create String in 4 ways in Java:
  1. as character array  char n[] = {'n','i','i','t'};
  2. by create an object with string class  String s1 = new String('niit');
  3. String s2 = "niit"; without a new keyword
  4. by Stringbuffer class object. StringBuffer b1 = new StringBuffer("niit")

StringBuffer is another String type mutable class. mutable means modified. we can modify it after the creation

نظرات 0 + ارسال نظر
برای نمایش آواتار خود در این وبلاگ در سایت Gravatar.com ثبت نام کنید. (راهنما)
ایمیل شما بعد از ثبت نمایش داده نخواهد شد