package com.codegym.task.task06.task0617;
/*
Notepad for new ideas
*/
public class Solution {
public static void main(String[] args) {
Idea idea = new Idea();
Idea.printIdea(idea);
}
public void printIdea(Idea idea){
System.out.println(idea.getDescription());
}
public static class Idea{
public String s;
public String getDescription(){
return s;
}
}
}
tell me whats happened here?
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
satya vath
20 November 2018, 13:54
+3
Mario
23 October 2018, 04:33
printIdea(Idea idea) is not a method of solution class. 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 . printIdea() should be static as per requirements of the problem. I think this may help you. 0
gery
19 September 2018, 22:28
requirement states: u dont have to create object of Idea class at line 10.
just re-write the line 10, 11 with printIdea(Idea idea);
rest everything will work fine
+1
Learner
13 September 2018, 06:40
printIdea is a static method. It is not a method of Idea class.
0
Roman
22 August 2018, 06:21
Idea class doesn't have printIdea method (line #11)
0