r/javahelp • • Sep 06 '15

I need help

For my assignment I need to do this....DECLARE AN INSTANCE VARIABLE CALLED NAME THAT CAN CONTAIN A VALUE SUCH AS "EGGS"....I have no idea where to start. If someone could help me get started hopefully I can finish the assignment. Thanks everyone

0 Upvotes

16 comments sorted by

View all comments

-1

u/king_of_the_universe Sep 06 '15

Well. Suppose there's a class called "Eggs". Then you would have to do this:

Eggs name;

That's the variable declaration.

-1

u/jbristow I'm no hero, son. Sep 06 '15

And the variable "name" (of type Eggs) is declared, but not instantiated.