[Go to site: main page, start]

0% found this document useful (0 votes)
12 views8 pages

Java Notes

The document provides an overview of Object-Oriented Programming (OOP) concepts, including definitions of classes, objects, constructors, and various principles such as inheritance, polymorphism, abstraction, and encapsulation. It also covers Java-specific components like JDK, JRE, and JVM, as well as database management concepts including keys, ACID properties, and join operations. Additionally, it discusses networking fundamentals, including the OSI model, protocols like HTTP and TCP, and devices like routers and switches.

Uploaded by

avnichawardol
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views8 pages

Java Notes

The document provides an overview of Object-Oriented Programming (OOP) concepts, including definitions of classes, objects, constructors, and various principles such as inheritance, polymorphism, abstraction, and encapsulation. It also covers Java-specific components like JDK, JRE, and JVM, as well as database management concepts including keys, ACID properties, and join operations. Additionally, it discusses networking fundamentals, including the OSI model, protocols like HTTP and TCP, and devices like routers and switches.

Uploaded by

avnichawardol
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1. What is OOPS?

Abbreviated as Object Oriented programming system, in which programs are considers as collection of object.
And object is nothing but instance of class.

2. What is class?
Class is a way to define blueprint or plan for creating objects, it describes details of the object. Objects created
from same class have similar characteristics and behavior.

3. What is Object?
Object is an instance of class, it has its own state, behavior and identity. They are created by using new keyword.
Objects are created by JVM.

Rectangle rec =new Rectangle(); // here LHS is declaring obj its reference name is rac and it is stored in stack
memory of its method in which it is created in that stack rec refers to an address that address is of object created
by RHS part this new Rectangle() creates object of class in Heap memory.
So object is created in heap memory and its reference is in stack memory of method stack.

4. What are constructors?


 Constructor is a special method used to create object of class.
 They are of same name as that of class but have no return type not even void, hence they cannot return
anything.
 Constructors are invoked whenever object of its associated class is created.
There are two types of constructors- parameterised and non parameterised or no argument constructor.

5. What is JDK?
Java development kit(like provided by oracle)Used to read write
and execute JAVA code.

6. Java development tool?


It compiles handwritten code into machine understandable
Bytecode. Compiler or Interpreter.

7. What is JRE?
Java runtime environment it consist of JVM and some libraries it can run code without compiling. But cannot
compile it. JAVAC compiler compiles the code which is provide by JDK.

8. What is JVM?
It runs bytecode regardless of any OS. It interprets bytecode into useful format. Executes .class file JVM has
memory allocations.

9. Inheritance
 Inheritance, one class shares the structure and behaviour from another class, it is inheriting properties of
parent, super keyword is used to refer instance var of parent class in child class. HERARCHY of classes
 We cannot access private methods of P class but we can access main method of P class so if pvt method is
assessed in main of P class we can access it in C class with the help oh main method of P class.
 Final class cannot be inherited.
 Allows code reusability and

10. Polymorphism
Means many form 1. Method Overloading- same class, same name, different arg or sequence , diff return type
wont work.
[Link] Overriding- Same name, same arg, same sequence return type but…. Inheritance is must.
@Override(always present in subclass)- indicates that the method written in subclass is intended to override the
method of supper class.

11. Abstraction
It means showing only required part and hiding complex or unnecessary details.
It can be achived using two methods [Link] class containing abstract method 2. Creating interfaces
1. Abstract class- it may contain abstract method(with no body) and normal method(with body). Body of
abstract method is written in inherited or say subclass, body of every abstract method must be written.
Abstract methods are only present in abstract class, abstract class need not contain abs methods always it
can only have normal methods.
Object of abstract method cannot be created.

2. Interfaces – as interfaces only contains abstract method and public methods. There is no need to write
abstract keyword in interface, for public method default keyword is used. Variables are public static final.
Multiple classes can implement same interface also one class can inherit multiple interfaces.

12. Encapsulation
It is protecting data hididng data. It’s a way to put data and method in a way that only we can control its access.
User will only give input and will be completely unaware of program.
Java enforces access control through access modifiers (public, private, protected) to prevent direct modification
of data and to ensure proper interaction with the object's methods.
2 ways to achieve encapsulation is 1. Making fields private(access modifier) 2. Getters and setters
Eg- ATM machine, candy machine put money press keys and get candy.

Encapsulation is data hiding but abstraction is detail


hiding
13. Heap memory
It allows us to create dynamic data stru like arrays objects etc
It has garbage collector. Stores instance var

14. Stack memory


Store ordering of functions methods

15. Interfaces
It contains Abstract methods that a class must define while implementing that interface. They can have different
implementation for different classes but all must be defined. class implement interface

16. Strings why are they immutable


String are stored in String constant pool and heap too in heap memory. they are always referred by JVM in SCP
and are not acceptable by garbage collector.

17. Overloading
Method within same class having same name but different parameters.

18. Overriding
Methods with same method name and same parameters but are written in child class of its parent class.

19. this keyword


it is used as reference to current instance of class. It is used to clarify difference between instance var and local
var in a situation when they share the same name.
1. Represent curr class instance var.
2. To invoke curr class method implicitly
3. to pass the current object as a parameter to another method.

20. super keyword


it is used to refer current class immediate parent class or superclass. It is used to refer members methods and
fields of superclass
1. Immediate parent class instance variable
2. Immediate parent class method
3. invoke immediate parent class constructor by passing args

21. final
1. new variable cannot be assigned
2. final methods cannot be overridden
3. final class cannot be inherited.

22. Static
They are shared.
Static variables – they can be shared with different objects
Static method – they can be called directly within the class without creating object of class.
Static block – executes automatically when class is loaded
Static class- members of static class can be accessed, instance are not created, cannot be inherited.

23. Runtime error and compile time error


Compile time error- happens in compilation phase when code is converted into machine understandable format.
Syntax error, referral error.
Runtime error – happened while program execution due to some unexpected conditions or issues.
24. Iterators
In Java collection framework, iterator allows you to traverse through all the elements one by one.

25. What is Java Collection framework


It is collection of interfaces and class, they are used to store and manipulate data.

26. Why java is called Object oriented


It is based on the concept of objects and classes.
Without the creation of objects and classes, it is impossible to write any code in Java.
Java supports the concepts of OOPS - Inheritance, Data abstraction, polymorphism, and data encapsulation.

27. Why to choose java


Java is well organised easy to understand and memory efficient language. It also provided obj oriented features
like abstraction

28. Main method


It has to be written as public static void main(String[] ags) as JVM specifically looks for these signatures
parameter return type and main as method name.
Static- tells that it belong to class and not its instance, we don’t need to create instance of class to access main
method.
Public – to make sure JVM can access it outside class.
String[] – array of string allows to pass command line arguments to main method

DBMS

1. Keys – attribute/column, it can be multiple can be one


Super key- it’s a column that can uniquely identify each record. schema and are non nullable.
Candidate key – subset of super key(set of potential primary key ONLY UNIQUE)
Primary key – any candidate key can be selected as primary key. It is unique. It may comprise of single or multiple
fields. They are defined while creating table. UNIQUE + NON NULL
Surrogate key- if there are no uniquely identifying key then we generate something by our own.
Composite key - group of key more than 1 attribute from same table
Compound key – have more than one attribute, they are simple key in one schema but composit in another.
Foreign key – is a set of key which creates referential relationship between two tables. It takes PK of one table as
refenced.

2. ACID
Automicity -the transactions must be fully completed or not, there should be no state in between.
Consistency – state of database must be consistent before and after transaction. A+B
Isolation – no transaction should know about each other, transaction 2 should happen after t1.
Durability – changes must persist even in system failure or hardware failure.

3. ER model
Er model stands for entity-relationship model . it defines data elements and relationships for specified system. It
is a diagrammatic representation of entity set attributes and there relationships
Entity – object or thing based on real world example, set of attributes
Weak entity- entity which do not have key attributes and are dependent on other entities.
Strong entity – entity which have key as its attribute

4. truncate – will delete all the rows in once. Its fast.


Does not have rollback option

5. Delete – it will delete one or more rows but not all. It will
Keep a log of its operations it has rollback, it is slow.

[Link]

advantages two tire are low maintenance , but less scalability


c less secure. In 3 tire o
dis adv -> Presentation tire(client layer)
Application tire(business layer)
Database tire.
2 tire 3 tire

6. What is DBMS and RDBMS


Database management system is software to store and retrieve data while taking appropriate security
measurements.
Relational database management system is based on relational model. It shows the relationship between them.
It stores data in the form of row and columns

7. JOIN(some attributes should be common in between two table to join them)


It’s a clause which join rows between two or more tables based on related columns between them.
Types of join –
Natural join- it finds the common columns with same name tables and create a new table
Cross join – cartesian product of two tables included in join. It includes all the attributes including duplicates
Self join –
Inner join – left right full.
Left join- It returns all the rows of table on the left side of the join. If any row on right do not match with left then
null is filled

8. View
View is a definition stored in database as expression. So every time we call that view those set of tuples are
computed.
Unlike real relations they are not stored in database.
create view view_name as

9. Alter – add column delete column

SELECT –

Select distinct name // will give distinct


Select all name will give duplicates

Select emp_name as employee // gives attribute named as employee

Select id, salary/12 as mothly_salary // arithmetic operations like +- are allowed

Where salary between 200 and 3000

Set operations – union (OR), intersect(And), except(ni

CNS

1. Topology
Network topology is a physical layout of network and there connections, different types are bus, star, ring,

2. OSI model(Open system interconnection) – deals with system that are open for communication with other.
Physical layer – used for making physical connections with other devices using fiber optics and so.
It is lowermost layer of model.
Data Link – links network layer to physical by converting data into data frames and adding address to it, then
sending it to physical layer. It enables error free transfer
Network layer – converts logical address into physical address. And finds best path for data to [Link]
Transport layer – It delivers the message to network and checks for error, it makes sure no error occurs to make
transfer of data smoother.
Session layer – it purpose is to begin end and maintain communication between systems.
Presentation layer - its purpose is to convert data from one format to another.
Application layer – it enables user to access network.

3. HTTP and HTTPS


Application layer protocol. Hyper text transfer protocol. Its is defined set of protocols between web browser and
web server.
They are used to exchange hypertext doc images over www.
They uses TCP hence forms connection and then break. They are connectionless. Means they are independent of
previous command.
HTTPS- it is secured version of http. It secures transactions by encrypting the communication and also helps to
identify server securely.

4. TCP UDP
TCP is a set of rules of how computer connect to internet. Uses 3 way handshake.
UDP send data using datagram , uses multicasting and broadcasting. Do not uses 2 way handshake

Transmission control protocol are most reliable, User Datagram protocol do not guaranty the
they guaranties the delivery of data to destination. delivery of data.

They are connection oriented They are connectionless and datagram oriented
They are slow as they need to fore connection first They are fast as they do not do so.
also they keep check on delivery of data
Retransmission of data is possible Retransmission is not possible.

5. What is IP
IP address is a numeric label which uniquely identifies and locate devices on computer network or internet.
It enable routing of data packets over internet. It establishes connection.

6. DNS
DNS stands for domain Name System, and it maps domain name to its allocated IP address.
It is used to locate resources easy to its ip address as its not easy to remember numeric value.

7. SMTP
Simple mail transfer protocol is is set of simple rules established between server to transfer mails over system.

8. MAC and IP
Both are used to uniquely define a device on internet. MAC 48 bit is unique address of device or say computer.
IP 32/128 bit address is used to uniquely identify connection of a network with that device.

9. Hub
Operated in physical layer.
It joins segments of LAN. It sends every packet which it receives. It do not do filtering. It has a repeater which
regenerates signal when they get weaker.
Used to transmit signal to each port.

10. Switch
It is operated in Data link layer. It is used to enable and terminate connections on basis of need. It provides
packet filtering.

11. Bridge
It can connect two LAN working on same protocol. It’s a combination of repeater and MAC address reading
capability so it can act as repeater too

12. Router
Router is used to connect various network simultaneously. It routes packets to its destination based on their IP
addresses.
It sends data between two similar networks. It is operated in network layer.

13. Gateway
Operated in all 5 layer. It is used to send data between two non similar devices.
I set my goals too high and then get overwhelmed
I seek for perfection and then it gets hard for me to manage everything
What do you expect from a fresher, how they should be, work culture

Good morning, my name is Avani Chawardol I’m a final year student [Link] in ENTC. I want to express my sincere
gratitude for giving me this opportunity to be here for an interview at Societe general.
Im a technology enthusiast, and I like to convert my ideas into reality. even though I come from electronics
background I try to grab every possible opportunity to learn about new tech.
Its not all technical I like to organize events and participate as much as possible, I take I have organised a few at
my college I’m hardworking.
Coming to technical aspect I have good knowledge of java dsa and other computer fundamentals.

You might also like