• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Simple Java

Dear all,

I am new to Java language and just trying to get to grips with it.

I have been given this question:

Write a class in which use instance variables name and myval and make objects of this  class and assign the value of myval  variable using Math.random() method and print the name of  objects who gets the maximum and minimum values .

The problem is it asking to print the name of objects wh gets the maximum and minimum values?

What are they asking from that?

Regards

Lyon JT
0
LyonJay
Asked:
LyonJay
  • 2
1 Solution
 
-epoch-Commented:
Can you please explain a bit better? and also post the code you have at the moment
0
 
LyonJayAuthor Commented:
I need to answer that question above basically.

I have no code at the moment i wanted to understand the question before i code it.

Regards


Lyon JT
0
 
-epoch-Commented:
sounds to me like they want you to make a class with 2 instance variables, one which is a name for the object and the other a random value.

then you need to print out the object that has the biggest value "myVal" and the object with the lowest.
the easiest would be to create your objects in a loop, and with another loop get maximum and minimum
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now