public class Solution {
public static void main(String[] args) {
printIdea(new Idea());
idea.getDescription("name");
}
public static void printIdea(Idea idea){
System.out.println(getDescription());
}
public static class Idea{
String s;
public String getDescription(String s){
return s;
}
}
}
help please...what causing error?
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Mario
23 October 2018, 04:31
getDescription() is not meant to accept param.This should be like
You do not need to change the main() method. printIdea(Idea idea) this method accept the Idea as param so as Idea is a static class so use dot operator to call getDescription() Method like 0
irfan
25 September 2018, 15:48
public class Solution {
public static void main(String[] args) {
printIdea(new Idea());
}
//write your code here
public static void printIdea(Idea idea)
{
System.out.println(idea.getDescription("irfan"));//we can pass any non-empty string
}
public static class Idea
{
String s = " ";
public String getDescription(String s)
{
return s;
}
}
}
0
Shahanshah Alam
26 September 2018, 06:34
its not working bro
0