Notepad for new ideas

  • 5
  • Locked
Great ideas need to be written down or they can be forgotten very quickly. To help with this, in the Solution class, create a static Idea class. Give it a public String getDescription() method that returns any non-empty string. Then create a static public void printIdea(Idea idea) method that displays a description of the idea.
You can't complete this task, because you're not signed in.
Comments (12)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Level 7 , Imphal , India
29 August 2020, 04:51
wha is non empty string
Karas Java Developer
2 September 2020, 22:21
IN this case is just any string, a litle confusing, just return any string it can be "hello" or "Hello World!" any string will do the trick.
Khongpak Phupkdee
Level 15 , Chiangrai, Thailand
25 March 2021, 03:52
Thank you
andy 6473
Level 9 , Bangalore, India
19 June 2020, 16:26
Static class with non static method. In this format to instantiate a Non-Static method , Static class object has to be created. That has been implemented in printIdea (new Idea()) where new keyword is used to create the constructor. In the printIdea method we are passing Idea object has the argument using which we will be able to access getDescription() method of the static idea class. once Idea object has been created , we will be able to access Non Static getDescription method.
Level 16 , Ashburn, United States
31 May 2020, 23:03
A slight change in Requirement #3 would make task much easier to understand: Current: 3. The getDescription method must return any non-empty string. Proposed: 3. The getDescription method must return a string and it cannot be empty. If you struggled with this as I did, you just need to literally return any String within the code. For example: return "description";
Level 41
13 October 2020, 14:46
@Admins, yes to this proposal!
Level 41
16 October 2020, 06:15
Thanks for the proposal, we'll consider it
Level 22 , Budapest, Hungary
21 June 2019, 17:22
I don't get this exercise. How should the getDescription() method return a description if there is no input?
Justin Smith
Level 8 , United States
10 November 2019, 22:21
I got hung up on that as well, the direction for "any non-empty string" is easy to misinterpret. You have the method return any string that isn't empty. So cat, yes, derp, 12345, literally anything as a string. I thought it was saying create logic to determine whether an input was empty or not, and then return it if it isn't empty.
Johnson Jose
Level 10 , Edinburgh, United Kingdom
17 May 2019, 06:58
The Idea class is a static class. What is the point of creating objects new Idea() ? I don't understand. How is this different from creating objects of a non-static class?
7 March 2019, 12:58
Can someone please explain what this exercise is asking? I don't understand what it is asking you to do, and also please help me to understand the concepts for this exercise. Thank you
Muhammad Vahhaaj
Level 19 , Rawalpindi, Pakistan
15 June 2019, 07:58
it says to make one static class, one method of that class and one static method of Solution class This exercise is intended to teach you the flow between static and non static classes. And that static methods and variable can only access static methods and variables