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);
}
}
Object o = "hello";
char charArray[] = {'a','b','c','d','e','f' };
incompatible types
found : java.lang.String
required: char
Agradeço...