that for running the following codes: [You are not allowed to change the code below] #Write your class code here data_type1 = DataType(‘Integer’, 1234) print(data_ty

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

# this is a python programming

# topic: OOP

 

Write a class that for running the following codes: 

[You are not allowed to change the code below] 

#Write your class code here 

data_type1 = DataType(‘Integer’, 1234) 

print(data_type1.name) 

print(data_type1.value) 

print('=====================') 

data_type2 = DataType(‘String’, ‘Hello’) print(data_type2.name) 

print(data_type2.value) 

print('=====================') 

data_type3 = DataType(‘Float’, 4.0) 

print(data_type3.name) 

print(data_type3.value) 

Output: 

Integer 

1234 

===================== 

String 

Hello 

===================== 

Float 

4.0 

Subtasks: 

  1. Create a class named DataType with the required constructor.
  2. Assign name and values in constructor according to the output.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,