package com.codegym.task.task19.task1901;
/*
TableAdapter
*/
public class Solution {
public static void main(String[] args) {
ATable aTable = new ATable() {
@Override
public String getCurrentUserName() {
return "Amigo";
}
@Override
public String getTableName() {
return "DashboardTable";
}
};
BTable table = new TableAdapter(aTable);
System.out.println(table.getHeaderText());
}
public static class TableAdapter implements BTable{
private ATable aTable;
TableAdapter(ATable aTable){
this.aTable=aTable;
}
public String getHeaderText(){
return "["+aTable.getCurrentUserName+"]: "+aTable.getTableName;
}
}
public interface ATable {
String getCurrentUserName();
String getTableName();
}
public interface BTable {
String getHeaderText();
}
}
package com.codegym.task.task19.task1901;
/*
TableAdapter
*/
public class Solution {
public static void main(String[] args) {
ATable aTable = new ATable() {
@Override
public String getCurrentUserName() {
return "Amigo";
}
@Override
public String getTableName() {
return "DashboardTable";
}
};
BTable table = new TableAdapter(aTable);
System.out.println(table.getHeaderText());
}
public static class TableAdapter implements BTable{
private ATable aTable;
TableAdapter(ATable aTable){
this.aTable=aTable;
}
public String getHeaderText(){
return "["+aTable.getCurrentUserName+"]: "+aTable.getTableName;
}
}
public interface ATable {
String getCurrentUserName();
String getTableName();
}
public interface BTable {
String getHeaderText();
}
}
cannot find symbol symbol: variable getCurrentUserName location: variable aTable of type com.codegym.task.task19.task1901.Solution.ATable:
Solution.java, line: 32, column: 30
Why I am getting this error?
Under discussion
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Ramilya
7 June 2019, 10:53
There is a typo - spaces before colon (:) and after colon (:) in the getHeaderText() method were missed.
0
parvinder
19 May 2019, 18:30
Typo. was missing parenthesis.
0