Question: Questions 1 Name the eight primitive data types in Java. Then, briefly define a reference data type with an example. Marks 1 2 What will

Questions
1 Name the eight primitive data types in Java. Then, briefly define a reference data type with an example.
Marks 1
2 What will be the result of the following expression in Java?
Marks 1
5**(8+3-22)-4%3
3 String Comparison: Consider the following strings:
Marks 3
String a= Hello, b= hello, c= HELLO;
What will be the results of the following comparisons?
a) a.compare To(b)
b) c.equals(a)
c) b.equalsIgnoreCase(c)
d) a.compare To(c)
4 What is the output of the following Java code fragment? (Assume other parts of the code are correct and the code runs successfully)
Marks 4
public class Main {
public static void main(String [] args){
int num 1=80;
int num2=3;
double num 3=64.0;
String text = "something";
System.out.println(num1+ num2);
System.out.printlin(num2+"+(int) Math.sqrt(num3));
System.out. println(text.substring (0,8), length ());
}
}
 Questions 1 Name the eight primitive data types in Java. Then,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!