Java assignment-1
Answer all the questions :
a) Differentiate between C, C++ and Java?
b) Explain the JVM and Byte codes?
c) What are the different data types in Java?
d) List the types of operators in Java.
e) What is an expression in Java?
f) Explain the scope of variable.
g) What are the types of decision-making statements in Java?
h) Why java is called machine independent language ?
i) Write the syntax of an if-else statement in Java.
j) Explain the difference between a++ and ++a with an example.
k) What does the ternary operator (? :) do in Java?
l) What is the purpose of the switch statement?
m) What does the break and continue statement do inside a loop?
n) What is the difference between while and do-while loop?
o) What is the difference between a class and an object?
p) What does the new keyword do in Java?
q) What is the use of the this keyword?
r) Does Java support multiple inheritance using classes? Why or why not?
s) What is the use of the super keyword in inheritance?
t) What do you mean by multidimensional array ?
Answer all the questions :
a) Explain the typecasting in java with suitable example .
b) List out the decision making statements available in Java. Explain with example.
c) List out the looping statements available in Java with suitable example.
d) What is Inheritance? Explain the different forms of Inheritance in Java with example.
e) Write a Java class Student with attributes name, rollNo,mark and a method
showDetails(). Create two student objects and display their details.
f) What is method overloading and overriding ? Write a program in java to illustrate
the concept of method overloading and method overriding .
g) Define an array .Write a Java Program to Find Largest and smallest Element in an
Array.