How to write variable description table for an array variable, please show with an example.
Answers
int marks[ ] =new int [ 6];
String names[ ] =new String [ 8];
double fraction[ ] =new double[ 2];
long mobileno[ ] =new long[ 7];
In above all examples, array is declared and initialised by different data types and sizes.
Now, Variable Description Table(V D T)
Data types Purpose
int to store marks
String. to store names
double to store fractional numbers
long to store mobile numbers
Hope it will help
for more java doubts ask me and follow me,
if any problem ask me again and Mark me brainlest if you like.
Variable Description Table
It is used to give a good idea about the variables that have been used in our program. It includes variable name, data type and description(i.e, for what purpose we are using the variable).
import java.util.*;
class test
{
public static void main();
{
Scanner Sc=new Scanner(System.in);
int IntegerData[]={23,43,78};
long LongData[]={9957773828,8283818484,456789234};
double DoubleData[]={1.2,3.3,8.4};
char CharacterData[]={'w','s','e'};
String StringData[]=(''cvfvg'',''cdvg'',''tgfd''};
for(int i=0;i<3;i++)
{
System.out.println(IntegerData[i]+"\t"+LongData[i]+"\t"+DoubleData[]+"\t"+CharacterData[i]+"\t"+StringData[i]);
}
}
}
Variable Description Table
Variable Name Data Type Description
IntegerData int To store integer data
LongData long To store long data
DoubleData double To store double data
CharacterData char To store character data
StringData String To store string data
i int To iterate the for-loop for display the data