• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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