a.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the int variable and assign the value
Integer i = new Integer(“23”);
//Print the required data fields
System.out...
b.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the int variable and assign the value
Integer i = new Integer(23);
//Print the required data fields
System.out...
c.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the int variable and assign the value
Integer i = new Integer.valueOf(“23”);
//Print the required data fields
System.out...
d.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the int variable and assign the value
Integer i = new Integer.parseInt(“23”,8);
//Print the required data fields
System.out...
e.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the double variable and assign the value
Double d = new Double();
//Print the required data fields
System.out...
f.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the double variable and assign the value
Double d = new Double.valueOf(“23.45”);
//Print the required data fields
System.out...
g.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the int variable and assign the value
int i = (Integer.valueOf(“23”)).intValue();
//Print the required data fields
System.out...
h.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the double variable and assign the value
Double d = (Double.valueOf(“23.4”);
//Print the required data fields
System.out...
i.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
//Declare the int variable and assign the value
int i = (Double.valueOf(“23”)).intValue();
//Print the required data fields
System.out...
j.
Explanation of Solution
//Class definition
public class test {
// Define main function
public static void main(String[] args) {
/*Declare the double variable and assign the
Value*/
String s = (Double.valueOf(“23.4”).toString();
//Print the required data fields
System...
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
- What are the memory sections for variables in the following code: int *x=new int; static int y; int z;arrow_forwardint test(int *x, int y){ x=&y; return(*x+y); } int main(void) { int x=1, y=6; test(&y, x); printf("%d %d %d", x, test (&y,x),y); return 0; } 1 2 6arrow_forwarddef square(x): return x * X def halve(x): return x // 2 def twice(f,x): """Apply f to the result of applying f to x >>> twice (square,3) 81 >>> twice (square, 4) 256 >>> twice (halve, 32) 8 >>> twice (halve, 80) 20 *** YOUR CODE HERE ***"arrow_forward
- After execution of the following code, what is stored in valueNum?All variables are using data type int. Note that num1=3, num2=5, and num3=7.if (num2> num3)if (num1 > num2)valueNum =num2;elsevalueNum =num3;elseif (num2 > num3)valueNum =num1;elsevalueNum = num3;a. the smallest value of num1, num2, and num3b. the largest value of num1, num2, and num3c. smaller of num1 and num2d. larger of num1 and num3e. randomly selected value from num1, num2, and num3Explain your answer.arrow_forwardIn Java:arrow_forwardHow do you fix this?arrow_forward
- #includecstdio.h> int x=10; void func1() 7 printf("x=%d\n", x); return; 8 10 int func2(int a, int b) 15 return a+b; 16 18 19 ... func3(...) 20 21 .. return ... int main() 27 { int x-1, y=2; func1(); 28 29 30 int z=func2(x, y); printf("z-%d\n", z); 31 34 Figure 2. C Program for Q2 What is the output after execution of line 29 and 32? a. b. func3() in line 19 to 23 is incomplete. Write the function, func30 to compute and print the volume of cuboid with length x, width y and height z. c. Complete line 33 to call func3() that you created in part (b).arrow_forwardWhat is the value stored at x, given the statements? int x; x = 6 / static_cast<int> (4.5 + 6.4);arrow_forwardNo plagiarism pleasearrow_forward
- def f(x: float) -> int: return int(x) def g(x: str) -> float: return float(x) y = f(g("3.14")) Select all of the following statements that are true: y's inferred data type is float O y 's inferred data type is str O y's inferred data type is int There is a type error in this program None of the above are truearrow_forwardAfter Exception of following statements: int x, y; char ch; cin ignore (7, 2'); cin.get(ch): cin ignore(10, '2'); cin>>y; cin ignore(15,'A'); cin>>x; Suppose the input was: 87.5 90 176 23 89 27 A 0.1. The values will be: x=6, y-23 and ch='A' False will be : x=87.5, y=90 , and ch='A' False will be : x=0, y=3 and ch='' True False will be : x=17, y=6 , and ch='A'arrow_forwardI need the solution for these 3 questions in java, please.arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,