//class should look like this ...
public class Artist {
String artistName;
//other attributes
//create constructor
public Artist(String name){
this.artistName = name;
}
}
//Next two line can be placed in other class
//(e.g. 1st line in class containing main function and 2st line in main function)
//create object/instance of class
Artist artist = new Artist(name);
//Use create instance of that class
System.out.println(artist.artistName);
我已经添加了此代码,我能够看到具有给定字段的表,但是图像没有出现在表中,而是即使图像是https URL,也会出现此错误。
conv.ask(new Table({
title: 'Emissions due to different gases',
// subtitle: 'Table Subtitle',
image: new Image({
uri: 'https://www.scienceabc.com/wp-content/uploads/2015/05/Walking-in-Rain.jpg',
alt: 'Emissions Image'
}),
columns: [
{
header: 'CO2',
align: 'CENTER',
},
{
header: 'CH4',
align: 'CENTER',
},
{
header: 'N20',
align: 'CENTER',
},
],
rows: [
// {
// cells: [carbonEmission, methaneEmission, nitrousEmission],
// dividerAfter: true,
// },
{
cells: ['row 2 item 1', 'row 2 item 2', 'row 2 item 3'],
dividerAfter: true,
},
{
cells: ['row 2 item 1', 'row 2 item 2', 'row 2 item 3'],
},
],
buttons: new Button({
title: 'Read More',
url: 'https://assistant.google.com'
}),