Skip to main content

Posts

AI Agents: What They Are and How They Will Change Work

Artificial intelligence has moved beyond simply answering questions and generating text. A new generation of AI systems—known as AI agents—is emerging with the ability to plan tasks, use tools, make decisions, and complete multi-step workflows with less human intervention. From managing emails and analyzing data to writing software and assisting customers, AI agents could significantly change how people work. What Are AI Agents? An AI agent is a software system that can perceive information, reason about a goal, take actions, and adapt based on the results. Traditional AI tools usually respond to a specific instruction. For example, you might ask an AI chatbot to summarize a document, and it provides a summary. An AI agent can go further. You could give an agent a goal such as: "Research three competitors, compare their pricing, summarize their main features, and prepare a report." The agent may then: 1) Understand the objective. 2) Break the task into smaller steps. 3) Searc...

Java important question - 13

What are the ways to initialize a final variable ?           We must initialize a final variable, otherwise compiler will throw compile time error. A final variable can only be initialize once, either via an initializer or an assignment statement. There are three ways to initialize a final variable, 1) You can initialize a final variable when it is declared. This approach is most common. A final variable is called blank final variable, if it is not initialized while declaration. Below are the two ways to initialize a blank final variable. 2) A blank final variable can be initialized inside constructor. If you have more than one constructor in your class then it must be initialized in all of them, otherwise compile time error will be thrown. 3) A blank final static variable can be initialized inside static block. What is the difference between transient and volatile variable in Java ? Transient:           In Java, it is used to specify th...

Java important question - 12

What is the use of final keyword in java ?           final keyword is used in different contexts. First of all, final is a non-access modifier applicable only to a variable, method or a class. Following are different contexts where final is used, a) Final variable -  To create constant variable. When a variable is declared with final keyword, it's value can't be modified, essentially a constant. This also means that you must initialize a final variable. If the final variable is reference this means that the variable cannot be rebound to reference another object, but the internal state of the object pointed by that reference variable can be changed. i.e. you can add or remove elements from final array or final collection. It is good practice to represent final variables in all uppercase, using underscore to separate words. Java interface variables are by default final and static. b) Final methods - Prevent method overridding. We can use the final keyword wit...

Java important question - 11

What is the difference between creating String as new() and literal ?           When we create String with new() operator, it's created in heap and not added into string pool. When String created using literal are created in String pool itself which exist in permgem area of heap.  String s = new String("Test");           This does not put the object in string pool, we need to call String.intern() method which is used to put them into String pool explicitly. When you create String object as String literal. Eg : String s = "Test" java automatically put that into String pool. Define a StringJoiner and write sample code ?           StringJoiner is a utility method to construct a string with the desired delimiter. StringJoiner strJoiner = new StringJoiner                                              ...