File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Help" Watch "Help" New topic
Author

Help

Justo Rivera
Greenhorn

Joined: Nov 05, 2012
Posts: 4
package encouragements;
public class PsalmC23V1{
protected String verse = "The Lord is my Shepherd, I shall not want.";
}

/* ----- Homework Questions -----

1. Without changing anything in this package, create a java program that imports the package and extends the PsalmC23V1 class to print out the contents of the protected verse variable to the screen.

*/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56540
    
  14

Welcome to the Ranch.

Where is your code? What problems are you having with it?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Justo Rivera
Greenhorn

Joined: Nov 05, 2012
Posts: 4
that is the code iwas given, with a question underneath
Justo Rivera
Greenhorn

Joined: Nov 05, 2012
Posts: 4
it will not run
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56540
    
  14

Of course not, that's the "Create a Java program" part of the assignment. You're supposed to write some code that uses the supplied class.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16815
    
  19

Justo Rivera wrote:it will not run


Of course, not. The part that runs is the part that you are supposed to write...

Justo Rivera wrote:/* ----- Homework Questions -----

1. Without changing anything in this package, create a java program that imports the package and extends the PsalmC23V1 class to print out the contents of the protected verse variable to the screen.

*/



So, what part of the homework assignment have you done so far? We can't give you a hint in the right direction, if you don't show us what you have done.

[edit: darn. beaten by less than 30 seconds]

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Justo Rivera
Greenhorn

Joined: Nov 05, 2012
Posts: 4
I sorry to bother you. I am lost, thank you anyhow.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16815
    
  19

Justo Rivera wrote:I sorry to bother you. I am lost, thank you anyhow.



Assuming that you haven't done anything.... how do you start?


create a java program that imports the package and extends the PsalmC23V1 class to print out the contents of the protected verse variable to the screen.



The first four words are "create a java program". Do you know how to create a basic skeleton program? If not, maybe it would be best to look through your class notes -- is there anything that shows you how to do this first step?

Henry
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 800
    
    2

Isn't this the same assignment?

Edit: Sorry for the typo, I was writing a reply on the phone. The link should be working now.


The quieter you are, the more you are able to hear.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help
 
Similar Threads
protected access
protected accessible?
access level
Why can't a class be protected?
Java Error