Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Type the following programs in Java. 3) Array initialization and manipulation Write a program to display on output the content of the following array, myArray;

image text in transcribed

Type the following programs in Java.

3) Array initialization and manipulation Write a program to display on output the content of the following array, myArray; Array examples: String[] myBouquet - new String[6]; int[] myArray = {7, 24, 352, 2, 37}; 4) Primitive type manipulations and memory usage public class primitive_type{ //The following //datatype stored in memory public static void main(String[] arg){ boolean result = true; char ch = ''; byte b = 100; short 5 - 10000; int = 100000; float fl - 12345f; double dou 12345.555555; Long long1 = new Long(12345L); System.out.println(longi); // Store 1 in bVar. byte bvar - Byte.parseByte("1"); System.out.println(bvar); 1/ Store 2599 in ivar. int ivar - Integer.parseInt("2599"); System.out.println(ivar); // Store 1e in svar. short svar - Short.parseShort("10"); System.out.println(svar); // Store 15988 in lvar. long lvar - Long.parselong("15988"); System.out.println(lvar); // Store 12.3 in fvar. float fvar - Float.parseFloat("12.3"); System.out.println(fvar); 11 Store 7945.6 in dvar. double dvar - Double.parseDouble("7945.6"); System.out.println(dvar); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Use brochures actively.

Answered: 1 week ago