Ae galera tenho o seguinte codigo abaixo:
[code]import javax.swing.*;
public class StringBufferAppend {
public static void main (String args[])
{
Object o = “hello”;
String s = “good bye”;
char charArray[] = {‘a’,‘b’,‘c’,‘d’,‘e’,‘f’ };
boolean b = true;
char c = ‘z’;
int i = 7;
long l = 10000000;
float f = 5.1f;
double d = 33.333;
StringBuffer buffer = new StringBuffer();
buffer.append( o );
buffer.append(" ");
buffer.append(charArray);
buffer.append(" ");
buffer.append(charArray,0,3);
buffer.append(" ");
buffer.append(b);
buffer.append(" ");
buffer.append(c);
buffer.append(" ");
buffer.append(i);
buffer.append(" ");
buffer.append(l);
buffer.append(" ");
buffer.append(f);
buffer.append(" ");
buffer.append(d);
JOptionPane.showMessageDialog(null,"buffer = "+buffer.toString(),"Metodo append",1);
System.exit(0);
}
}[/code]
E gostaria de saber o que seria esse Object Object o = "hello";
e o que ele pode receber como arguento.
E porque quando eu coloco aspa ( " ) duplas no array char charArray[] = {'a','b','c','d','e','f' };
ele me da um erro de incompatible types
found : java.lang.String
required: char
Agradeço…