100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

Test (elaborations) Computer programming

Puntuación
-
Vendido
-
Páginas
5
Grado
A+
Subido en
22-04-2025
Escrito en
2024/2025

Perfect for examination preparation , it includes multiple questions for revision.

Institución
Senior / 12th Grade
Grado
Computer programming









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Senior / 12th grade
Grado
Computer programming
Año escolar
4

Información del documento

Subido en
22 de abril de 2025
Número de páginas
5
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

STRINGBUFFER DATA TYPE
You can declare an object of StringBuffer type. This creates reasonable space in the mem
called Buffer to contain a string. The following statements are used to create StringBu2
objects:
" StringBuffer m=new StringBuffer( );
This allocates an empty space in the memory to store a string.
" StringBuffer m=new StringBuffer("COMPUTER");
The above statement allocates memory for variable m and initialises it with su
"COMPUTER".
"StringBuffer m=new StringBuffer(25); maximum
The above statement allocates memory space for storing astring up to a
25 characters.
characteristo
Once an Object is created as possesses the following
StringBuffer
() It refers to as a specific length in type, it po
(ii) The length can be memorv to contain characters. Programmersbyus
SetLength( ) function.changed according to the need of the charate
(ii) If a string has bigger object, then the
length than the size of
exceeding the size are
(i0) If a string is truncated. StringButter contains
smaller than the size of the then it
characters (\u0000) in the empty
space.
StringButfer object,

, sIringBufferFunctions
Therearesonme functions especially used on the StringBuffer object. These functions are
discussedbelow:

Append(
)
Thisfunction is used to add a string at the end of another string.
$yntax: StringBuffer variable1.append(StringBuffer variable2);
Forexample,
rBuffer k =new StringBuffer("COMPUTER"):
StringBufter p= new StringBufer("APPLICATIONS");
kappend(p):
the value for 'k' as COMPUTERAPPLICATIONS.
Itreturns
Note: You must keep in your mind that a StringBuffer function doesn't use extra variable for
storingthe result. The change is saved in the current object through which the function is
called.




setCharAt()
specified index.
This function can be used toreplace a character with another character at
Character):
Syntax: StringBuffer variable.setCharAt(Index,
For example,
StringBuffer s=new StringBuffer("COMMUTER");
S.setCharAt(3, 'P');
It will return the value for s as COMPUTER.

insert()
specified index into another string.
Ihis function allows you to insert a string at a
variable2);
Syntax: StringBuffer variablel.insert(index, StringBuffer
For example,
DtingBuffer s=new StringBuffer("COMPUTER FUN");
DUngBuffer p=new StringBuffer(" 1S;
sinsert(8, p): IS FUN.
It will return the value for s as COMPUTER

delete()
This function is used to deletethe characters from one index to another index of
a string.

variable.delete(index1, index2);
Synt a x: : StringBuffer thanindex2
index2 would mean atleast 1 position less
Here,
For example,
StringBuffer S=neW StringBuffer("COMPUTER");
from
characters positioned
s.Itdelwielte(3,return5); the value for S as COMTER,
as it removesthe

hdex 3 to index
(5-1).
$9.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor
Seller avatar
tisyaverma

Conoce al vendedor

Seller avatar
tisyaverma Physics wallah
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
0
Miembro desde
8 meses
Número de seguidores
0
Documentos
13
Última venta
-

0.0

0 reseñas

5
0
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes