1
Exercise 1 Give the answers of the following questions:- 1. What is the most important feature of Java? 2. What do you mean by platform independence? 3. What is a JVM? 4. What is a pointer and does Java support pointers? 5. Is Java a pure object oriented language? 6. What is difference between Path and Classpath? 7. What are local variables? 8. What are instance variables? 9. Should a main method be compulsorily declared in all java classes? 10. Why the main method is declared static? 11. Does the order of public and static declaration matter in main method? 12. Which package is imported by default? 13. Can a class declared as private be accessed outside its package? 14. What is the access scope of a protected method? 15. When will you define a method as static? 16. What are the restrictions imposed on a static method or a static block of code? 17. What is the importance of static variable? 18. Can we declare a static variable inside a method? 19. What is casting? 20. What do you understand by private, protected and public? 21. Is null a keyword? 22. Is the ternary operator written x : y ? z or x ? y : z ? 23. If a class is declared without any access modifiers, where may the class be accessed? 24. What is the difference between a while statement and a do statement? 25. What is the difference between the prefix and postfix forms of the ++ operator? 26. What is meant by object Oriented Programming? 27. What are the core OOP's concepts? 28. What is an Object? 29. What is meant by abstraction? 30. What is meant by Encapsulation? 31. What is meant by Inheritance? 32. What is meant by Polymorphism? 33. What is a destructor? Is Java Support Destructor? 34. What is an Instance? 35. What happens when you add a double value to a String? *******

Exercise 1

Embed Size (px)

DESCRIPTION

java excercise

Citation preview

Page 1: Exercise 1

Exercise 1 Give the answers of the following questions:-

1. What is the most important feature of Java? 2. What do you mean by platform independence? 3. What is a JVM? 4. What is a pointer and does Java support pointers? 5. Is Java a pure object oriented language? 6. What is difference between Path and Classpath? 7. What are local variables? 8. What are instance variables? 9. Should a main method be compulsorily declared in all java classes? 10. Why the main method is declared static? 11. Does the order of public and static declaration matter in main method? 12. Which package is imported by default? 13. Can a class declared as private be accessed outside its package? 14. What is the access scope of a protected method? 15. When will you define a method as static? 16. What are the restrictions imposed on a static method or a static block of code? 17. What is the importance of static variable? 18. Can we declare a static variable inside a method? 19. What is casting? 20. What do you understand by private, protected and public? 21. Is null a keyword? 22. Is the ternary operator written x : y ? z or x ? y : z ? 23. If a class is declared without any access modifiers, where may the class be accessed? 24. What is the difference between a while statement and a do statement? 25. What is the difference between the prefix and postfix forms of the ++ operator? 26. What is meant by object Oriented Programming? 27. What are the core OOP's concepts? 28. What is an Object? 29. What is meant by abstraction? 30. What is meant by Encapsulation? 31. What is meant by Inheritance? 32. What is meant by Polymorphism? 33. What is a destructor? Is Java Support Destructor? 34. What is an Instance? 35. What happens when you add a double value to a String?

*******