4
K u v e m p u U n i v e r s i t y Assignments for B.Sc.(IT) & M.Sc.(IT) Courses Subject: JAVA Programming Subject Code: BSIT - 42 Assignment: TA (Compulsory) 1) Explain basic features of Java. 2) Explain how Java differs from C and C++. 3) What is the difference between object oriented and procedure oriented programming ? 4) Explain the following OOPs concept. a) object and classes. b) Abstraction. c) Encapsulation. d) Inheritance. e) Polymorphism. f) Message passing. 5) What are the advantages of object oriented programming ? 6) Explain the structure of a Java program. 7) With an example explain Java tokens. 8) With an example explain different data types in Java. 9) With an example explain all the operators in Java. 10) With an example explain the following statements in Java. a) simple if b) if..else c) nested if d) else..if ladder

Assignment b42

Embed Size (px)

Citation preview

Page 1: Assignment b42

K u v e m p u U n i v e r s i t y

Assignments for B.Sc.(IT) & M.Sc.(IT) CoursesSubject: JAVA ProgrammingSubject Code: BSIT - 42

Assignment: TA (Compulsory)

1) Explain basic features of Java.

2) Explain how Java differs from C and C++.

3) What is the difference between object oriented and procedure oriented programming ?

4) Explain the following OOPs concept.

a) object and classes.

b) Abstraction.

c) Encapsulation.

d) Inheritance.

e) Polymorphism.

f) Message passing.

5) What are the advantages of object oriented programming ?

6) Explain the structure of a Java program.

7) With an example explain Java tokens.

8) With an example explain different data types in Java.

9) With an example explain all the operators in Java.

10) With an example explain the following statements in Java.

a) simple if

b) if..else

c) nested if

d) else..if ladder

11) With an example explain the switch statement in Java.

12) Compare while and do..while statements in Java.

13) With an example explain for statement in Java.

14) With the help of an example program explain break and continue statements in Java.

Page 2: Assignment b42

Assignment: TB (Compulsory)

PART-A1. How platform independence is achieved in JAVA ? 2. List any three features of JAVA. 3. What is Java C, Javadoc and Jdbc? 4. List different features of OOP. 5. Name different types of Java tokens. 6. What is the task of the main method in Java program ? 7. Why can’t we use a keyword as a variable name ? 8. Why main method in Java is declared as static ? 9. Write an equivalence of switch statement and if statement. 10. Constructor is_____________. PART - B1. a) What is inheritance and how one can achieve code reusability? Explainwith an example. b) What is a class? How does it accomplish data hiding? Explain with example. 2. a) Compare in terms of their functions and semantics the following pairs ofstatements:i) do while and whileii) while and foriii) nested if and switchiv) break and continue. b) Write a program to find sum of the following harmonic series for a given valueof n 1+ 1/2 + 1/3 + . . . .+ 1/n. 3. a) Explain different data types in Java with example. b) Describe the structure of a typical Java program. 4. a) What is JVM ? How does it help to achieve platform independence? If JVM isavailable for windows then can we run program written on Unix platform ?Comment. b) How are data and method organized in an object oriented program ? Illustratethe same for car object. 5. a) Distinguish between the following terms:i) Dynamic binding and message passing.ii) Inheritance and polymorphism. b) What are the difference between C and Java ?How Java and C++ are similar? 6. a) Define programming. What are the types of programming? Explain. b) Explain bitwise operators in Java with example. 7. a) List and explain different types of loops in Java. b) What is polymorphism? Explain method overriding with example and provethat it is a polymorphism. 8. a) What is a parameterised constructor? Explain its usage with an example.

Page 3: Assignment b42

b) Explain the methods(i) Trim(ii) Substring(iii) Length.