We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


Simple Java

LyonJay asked
Medium Priority
Last Modified: 2013-11-23
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?


Lyon JT
Watch Question

Can you please explain a bit better? and also post the code you have at the moment


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.


Lyon JT
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.