TCS Interview Questions for Software Developer | Core Java | Technical Questions смотреть онлайн
In this session - we will discuss about the interview questions for TCS.
Q. What is Stream Api?
Ans:- Stream is from Java.util.stream package
Stream is used to process the collection of objects
It is a sequence of object that supports various methods which can be pipelined to produce the desired result.
It doesn't store any elements.
Operation is functional ion nature- it doesn't modify the source data – if the operation is done
Q. Do you know Stream is Lazy?
Ans:- Yes, Stream is Lazy and evaluates code only when required
Public class Employee {
private int age;
}
Here, if I remove Terminal operation and run our program with intermediate operation then in console – No print in console as there is SOP in filter method.
Q. How many types of Memory in JVM
Ans :- 1. Method Area:- For every JVM, One method area will available. Method area will be created at the time of JVM startup. Here stack variable will be store,constant pool of class will be stored inside method area, method area can be accessed by multiple thread simultaneous,so it is not thread safe.
2. Heap Area:- For every JVM, one heap area is available, Heap area will be created at the time of jvm startup.Object and corressponding instance variable will be store in heap area.Every array in java is object so store in heap area.Heap are can be access by multiple threads heanse data store in heap is not thread safe. Heap are need not to be continous memory.
3. Stack Area:- For every thread, jVM will create a seprate stack, at time of thread creation. Each and every method call permoved by that thread will be store in a stack including local variable also. After completing all method the corresponding entry from the stack will be removed. After that stack will be empty and that empty stack will be destroyed by jvm just before terminating the thread. The data stored in stack is available from only for coresponding thread and not available to remaining thread.
4. PC Register:- separate PC register will be created at the time of thread creation it contain the address of current executing instruction Once the execting instruction completes automatically PC register will be increment to holdaddress of next instruction.
5. Native Method Stack:- For every thread .JVM will be create a separate Native method stack. All native method stack invoked by thread will be stored in the corresponding native method stack
Why we need Linked Hashset, when we already have the Hashset and Treeset?
Ans:- Hash set and treeset classes are added in jdk 1.2 version – while linked hashset was added to the jdk version 1.4.
Hashset provides constant time performance for basic operation like add, remove and contains method but elements are unordered.
In treeset elements are naturally sorted but there is increased cost associated with it.
So linnked hashset is added in jdk 1.5 to maintain ordering of the elements without incurring increased cost.
Q. Can we override static method?
Ans:- we cannot override static methods , static methods are belongs to class , not belong to object, inheritance will not be applicable for class members
Q. Difference between super() and this();
Ans:- Super() is used to call super class constructor
whereas this() used to call constructor in same class, means to call parameterized constructor
Q. Q. What is transient variable in java and where we use it?
Ans- Transient variable cannot be serialized during serialization process – transient variable states will not be serialized , state of the value will always be default after deserialization.
Q Incase , there is a return at the end of try block, will execute finally block?
Ans:- Yes – Finally block will execute even after writing return statement at the end of the try block. It return after executing finally block
Array list – Accessing elements are faster with Array list coz it is index based
Linked List – Accessing elements with LinkedList is difficult – it is slow process. To access any element which is in the middle or at last we need to iterate or navigate through the element one by one.
Array list - Insertion and deletion is slow with Array list coz during these operations Array list need to adjust the indexes according to deletion or insertion, if you are performing on middle index.
LinkedList - Insertion and deletion is much faster with linkedlist because if you know the node, just change the pointers before or after nodes.
#tcs #corejava #java
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «TCS Interview Questions for Software Developer | Core Java | Technical Questions» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.