JAVA JDK only, please show all code. public class DataTypeClass { // A ? where A
ID: 3697561 • Letter: J
Question
JAVA JDK only, please show all code.
public class DataTypeClass
{
// A ? where A includes three following lines
private String str;
private static int intNum = 0;
private double doubleNum ;
// B ?
public DataTypeClass()
{
str = “unknown”;
doubleNum = 0.0;
}
// C ?
public DataTypeClass (String s, double d)
{
str = s;
doubleNum = d;
}
// D ?
public static void staticMethod ( )
{
intNum ++;
}
// E ?
public void setString (String s)
{
str = s;
}
// F ?
public int getIntNum()
{
return intNum;
}
// G ?
public String toString()
{
Return “String = “ + str + “ Integer Number = “ + intNum;
}
}
Question1:
Provide the name of the above session or methods
A.________
B.________
C._______
D._______
E._______
F._______
G._______
Explanation / Answer
A.Instance variables.
B.Default constructor
C.Parameterized constructor
D.Static method
E. setter method(Mutators)
F.getter method(Accessors)
G.String type method, returns string object representing this integer value.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.