History, asked by abhiram7718, 1 month ago

Distinguish between primitive and non-primitive data types.

Programs:

1. Write a program in Java to take 3 input values from user (run-time) and calculate and display the average of those no’s.

(Hint: (a+b+c)/3)

2. Write a program in Java to calculate the simple interest. Value of principal, rate and time should be entered by user run-time.

(Hint: (p*r*t)/100)

Answers

Answered by Itzgirl45
5

Answer:

The main difference between primitive and non-primitive data types are: Primitive types are predefined (already defined) in Java. Non-primitive types are created by the programmer and is not defined by Java (except for String ). ... A primitive type has always a value, while non-primitive types can be null

Itzgirl45

Similar questions