0% found this document useful (0 votes)
186 views2 pages

No - Hands-On Assignment Topics Covered Status

The document discusses several hands-on Java programming assignments involving numeric wrapper classes like Integer and Double. The assignments include printing the minimum and maximum values of each wrapper class, accepting a command line integer argument and printing its binary, octal and hexadecimal values, and accepting an integer from the user and displaying its string representation in binary format with leading zeros. The final task involves cloning an employee object, changing the original, and observing the change in both objects.

Uploaded by

SHIVA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
186 views2 pages

No - Hands-On Assignment Topics Covered Status

The document discusses several hands-on Java programming assignments involving numeric wrapper classes like Integer and Double. The assignments include printing the minimum and maximum values of each wrapper class, accepting a command line integer argument and printing its binary, octal and hexadecimal values, and accepting an integer from the user and displaying its string representation in binary format with leading zeros. The final task involves cloning an employee object, changing the original, and observing the change in both objects.

Uploaded by

SHIVA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

No Topics

Hands-on Assignment Status


. Covered

Write a java program which generates the minimum and maximum


value for each of the Numeric Wrapper classes (Byte, Short,
nteger, Long, Float, Double)

Sample Output:
Integer range:
min: -2147483648
max: 2147483647
Double range:
min: 4.9E-324
max: 1.7976931348623157E308
Long range:
Wrapper
1
min: -9223372036854775808 Class

max: 9223372036854775807
Short range:
min: -32768
max: 32767
Byte range:
min: -128
max: 127
Float range:
min: 1.4E-45
max: 3.4028235E38

2 Wrapper
Accept a integer number as Command line argument from the Class
program and when the program is executed print the binary,
octal and hexadecimal equivalent of the given number.

Sample Output:

java Test 20
Given Number :20
Binary equivalent :10100
Octal equivalent :24
Hexadecimal equivalent :14

Refer Java Documentation and look for the appropriate Wrapper


class method

Define a java class that accepts an integer(between 1 and 255)


from the user and displays the String representation of the
argument passed as an unsigned integer in base 2. The output
displayed should contain 8 digits and should be padded with
leading 0s(zeros), in case the returned String contains less
than 8 characters.

For example, if the user enters the value 16, then the output
should be

00010000 Wrapper
3
Class

and if the user enters the value 100, the output should be

01100100

You are expected to use Integer class conversion method/s


described in the PDF file. Use Scanner class to accept user
inputs.(Hint : You may use String.format() method for the
expected output)

Create an employee object and initialize its properties.


Create a clone of this object and store it in a different
4 object. Now change the properties of the first employee object.
Print both the objects and observe the change.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy