{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "markdown", "source": [ "1. how is Java platform independent?\n", "2. features of Java\n", "3. Java supports only object oriented programming approach\n", "4. JVM gives machine code from byte code, Java compiler gives byte code and its platform independent\n", "5. JDK > JRE > JVM >\n", "6. Interpreter read high level code and execute them\n", "7. Java keywords\n", "8. public class test must have test.java name of file\n", "9. if not public class name of file can be different, class file will be the name of test\n", "10. assert keyword\n", "11. equality is done with switch, if is used for boolean expression\n", "12. \n", "\n" ], "metadata": { "id": "YvZlhMaz29XQ" } }, { "cell_type": "markdown", "source": [], "metadata": { "id": "fASpAc_OJ9Ku" } }, { "cell_type": "markdown", "source": [ "1. The process of defining more than one method in a class with different method signature is called method overloading\n", "2. When an object has many forms it is called as polymorphism\n", "3. Objects communicate with each other with help of messages\n", "4. Cohesion is about handling single well defined task\n", "5. Inheritance is aquiring properties from super entity\n", "6. memory is allocated to object with help of 'new' operator\n", "7. Two variable with same name can't be created in a class\n", "8. class@hexadecimal form of object is returned when you Sysout object without overriding toString() method\n", "9. Byte data type in Java has size of 256 when you assign Integer 257 to the buffer pointer rolls to next value after 256 i.e. 1. \n", "10. Java.lang.Byte.byteValue casts Integer to Byte type.\n", "11. https://www.edureka.co/blog/instance-variable-in-java/\n", "12. default value of reference variable used as instance variable will be null, but when object reference is declared as a local variable with the method, it will have garbage value\n", "13. By using encapsulation we can control what parts of program can access members of its class\n", "14. Inheritance uses 'is a' type of relationship with 'extends' keyword Eg. dog is an animal which can use sound method\n", "15. Polymorphism is a mechanism which allows object as many types in the form of different subclasses\n", "16. OOPS concepts in Java - Inheritance, Encapsulation, Polymorphism, Abstraction\n", "17. Polymorphism is achieved by method overloading and method overriding \n", "18. method overloading is determined at compile time hence it is also called as compile time polymorphism\n", "19. Abstraction is concept of defining real world objects in terms of classes or interfaces\n", "20. A class acts as a container of encapsulating properties\n", "21. Association happens when objects have many to many relationship and there is no owner while each having life cycle of its own\n", "22. Composition occurs when child object gets killed if parent object gets killed. \n", "23. Method overriding is both inheritance and polymorphism at the same time\n", "24. Funtion overloading can be used to write multiple methods with the same name in a class\n", "25. One object is having instance of another object is called as composition \n", "26. " ], "metadata": { "id": "8ZxEPeFW3cm-" } }, { "cell_type": "markdown", "source": [ "1. char occupies 2 bytes, 2 * 8 = 16 so -\n", "2. " ], "metadata": { "id": "zD8982S1ZuAH" } }, { "cell_type": "markdown", "source": [ "Day 2\n", "1. write a person class with getter setter methods\n", "2. j=j++ => j is assigned first and then incremented\n", "3. finalize is not a keyword https://www.scaler.com/topics/finalize-method-in-java/\n", "4. final keyword https://www.w3schools.com/java/java_modifiers.asp\n", "5. " ], "metadata": { "id": "5VyXHoTSJ-Pl" } } ] }