The document discusses exception handling in Java with examples. It explains that exception handling helps recover from unexpected situations using try-catch blocks. A finally block is used to ensure that cleanup code like closing connections always runs, even if an exception occurs. Finally blocks are executed in all cases except if an exception is thrown within the finally block itself or if the JVM crashes.
The document discusses variable arguments or varargs in Java. It provides an example method called sum that can take a variable number of integer parameters. Inside the method, a variable argument is similar to an array and can be treated as if it is declared as an int array. Variable arguments allow calling a method with different numbers of parameters in a flexible way. The document also discusses static and instance initializer blocks, which allow code to run when a class is loaded or object is created respectively.
The document discusses threads in Java. It explains that threads allow code to run in parallel, improving performance over sequential execution. It provides an example of downloading cricket statistics concurrently using threads versus sequentially. It then describes how to create threads by extending the Thread class and implementing the Runnable interface. It also explains how to start threads and the different possible states a thread can be in.
OCA Java SE 8 Exam Chapter 6 Exceptionsİbrahim Kürce
A program can fail for just about any reason. Here are just a few possibilities:
The code tries to connect to a website, but the Internet connection is down.
You made a coding mistake and tried to access an invalid index in an array.
One method calls another with a value that the method doesn't support.
The document discusses 201 core Java interview questions organized into different categories like basics of Java, OOPs concepts, strings, threads, and JDBC. It provides short answers to questions on topics like the JDK, JRE, JVM, static methods, inheritance, polymorphism, method overloading and more. The answers are meant to help candidates prepare for 90% of frequently asked interview questions.
- The document discusses multithreading concepts in Java like thread life cycle, creating threads, thread synchronization, and inter-thread communication.
- It explains that threads are lightweight subprocesses that share memory space for better efficiency compared to processes. Threads can run concurrently to achieve multitasking.
- The key methods for working with threads are discussed including start(), sleep(), join(), getName(), setName() and currentThread().
OCA Java SE 8 Exam Chapter 5 Class Designİbrahim Kürce
Inheritance is the process by which the new child subclass automatically includes any public or protected primitives, objects, or methods defined in the parent class.
We refer to any class that inherits from another class as a child class, or a descendent of that class.
We refer to the class that the child inherits from as the parent class, or an ancestor of the class.
The document discusses Java exception handling concepts. It explains that multiple catch blocks can be used to catch different types of exceptions, with the first matching exception handler executing. Finally blocks provide code that is always executed after a try/catch block, such as for cleanup. Finally blocks ensure code is executed whether an exception occurs or not.
This document provides a summary of key Java concepts and answers to common Java interview questions. It begins with an introduction explaining what the presentation covers. The bulk of the document consists of questions and detailed answers on topics like exceptions, abstract classes, strings, arrays, collections, inheritance and polymorphism.
Access our sample Java8 certification questions.
1z0-808 certification questions ready to be used.
For each 1z0-808 certification question you can find the solution, the explanation and the exam objective of 1z0-808
Concurrency on the JVM showing the nuts and bolts of Akka (I presume .. it's not first-hand stuff I'm saying, just speculating). Java Memory Model, Thread Pools, Actors and the likes of that will be covered.
The document provides an overview of exceptions in Java. It defines errors and exceptions, describes different types of exceptions including checked and unchecked exceptions, and explains key exception handling keywords like try, catch, throw, throws, and finally. The document aims to help programmers better understand exceptions and how to properly handle errors in their Java code.
The document discusses multithreading and threading concepts in Java. It defines a thread as a single sequential flow of execution within a program. Multithreading allows executing multiple threads simultaneously by sharing the resources of a process. The key benefits of multithreading include proper utilization of resources, decreased maintenance costs, and improved performance of complex applications. Threads have various states like new, runnable, running, blocked, and dead during their lifecycle. The document also explains different threading methods like start(), run(), sleep(), yield(), join(), wait(), notify() etc and synchronization techniques in multithreading.
The document discusses exception handling in Java. It defines exceptions as runtime errors that occur during program execution. It describes different types of exceptions like checked exceptions and unchecked exceptions. It explains how to use try, catch, throw, throws and finally keywords to handle exceptions. The try block contains code that might throw exceptions. The catch block catches and handles specific exceptions. The finally block contains cleanup code that always executes regardless of exceptions. The document provides examples of exception handling code in Java.
This document discusses exception handling in Java. It defines an exception as an event that disrupts normal program flow, such as an error. Exceptions are represented by objects that describe the error condition. The document explains Java's exception hierarchy with Throwable at the root and Exception and Error as subclasses. It covers exception handling keywords like try, catch, throw, throws and finally. It provides examples of exception handling code and describes how to define custom exception classes by subclassing Exception.
Do you have what it takes to ace a Java Interview? We are here to help you in consolidating your knowledge and concepts in Java. The following article will cover all the popular Java interview questions for freshers as well as experienced candidates in depth.
Go through all the questions to enhance your chances of performing well in the interviews. The questions will revolve around the basic and core fundamentals of Java.
So, let’s dive deep into the plethora of useful interview questions on Java.
This document discusses key concepts in Java including abstraction, encapsulation, inheritance, polymorphism, and interfaces. It defines these concepts and provides examples. Abstraction hides unnecessary details and shows essential information. Encapsulation wraps data and functions into a single unit. Inheritance allows a subclass to acquire properties of another class. Polymorphism supports method overloading and overriding. Interfaces can be used to implement inheritance between unrelated classes and specify what a class must do without defining how. The document also discusses access specifiers, modifiers, variables, literals, and static and final keywords.
Identifiers in Java refer to variables, methods, classes, packages and interfaces by name rather than being the things themselves. Parameters passed to methods are passed by value. A constructor creates an instance of a class by allocating memory and initializing the object. Packages in Java are used to organize related classes and interfaces and provide access protection.
Java was created in 1991 by James Gosling, Mike Sheridan, and Patrick Naughton at Sun Microsystems. It has three editions: Java ME for limited devices, Java SE as the core platform for desktops and servers, and Java EE for large enterprise applications. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM) making Java portable across platforms. Key principles of Java include being object-oriented, secure, and platform independent.
Java handles two types of exceptions - unchecked exceptions and checked exceptions. Unchecked exceptions do not need to be handled by programmers, while checked exceptions must be handled. Checked exceptions are environment or server-related issues outside a programmer's control. There are three ways to handle checked exceptions: try-catch blocks, throwing exceptions with the throw keyword, or specifying exceptions with the throws keyword in method signatures. Finally blocks are used to ensure cleanup code executes after try or catch blocks complete.
This document discusses Java exceptions including:
1. The complete try-catch-finally syntax and minimum try-catch syntax.
2. Multilevel catch blocks and the invalid syntax of super-type catch blocks first.
3. The finally block always executes regardless of exceptions and can override return statements.
4. From Java 7, multiple exceptions can be caught in a single catch block.
5. Additional exception facts like the Throwable supertype and checked vs unchecked exceptions.
Mocking allows you to test classes and methods in isolation by replacing their collaborators with mock objects that simulate the normal environment. EasyMock is a framework for creating mock objects that uses a record/replay approach where you first define the expected behavior of mock objects and then replay the code under test to verify it behaves as expected. Mock objects can be normal, strict, or nice depending on how strictly they enforce the expected behavior and order of method calls.
Exception handling in Java allows programs to deal with errors and unexpected conditions gracefully. The try block encloses code that might throw exceptions. When an exception is thrown, the runtime system searches the call stack for a catch block that can handle the exception. The finally block always executes after the try and catch blocks complete to ensure cleanup code runs. Custom exceptions can be created by extending the Exception class.
This document provides an overview of topics that are important to know for Java interviews, including core Java topics like platform independence, wrapper classes, strings, arrays, and enums. It also lists some key differences between Java and C++. The document recommends reviewing these topics in detail as well as watching related tutorial videos to prepare for Java interviews.
1. JIRA can be used to manage the entire project lifecycle from requirements through testing and release.
2. Key aspects that can be configured in JIRA include projects, versions, components, epics, requirements, test cases, sprints, and test execution.
3. Requirements, test cases, and other issue types can be linked together for traceability, and test cases can be organized into test cycles and executed from within JIRA.
The document discusses Java exception handling concepts. It explains that multiple catch blocks can be used to catch different types of exceptions, with the first matching exception handler executing. Finally blocks provide code that is always executed after a try/catch block, such as for cleanup. Finally blocks ensure code is executed whether an exception occurs or not.
This document provides a summary of key Java concepts and answers to common Java interview questions. It begins with an introduction explaining what the presentation covers. The bulk of the document consists of questions and detailed answers on topics like exceptions, abstract classes, strings, arrays, collections, inheritance and polymorphism.
Access our sample Java8 certification questions.
1z0-808 certification questions ready to be used.
For each 1z0-808 certification question you can find the solution, the explanation and the exam objective of 1z0-808
Concurrency on the JVM showing the nuts and bolts of Akka (I presume .. it's not first-hand stuff I'm saying, just speculating). Java Memory Model, Thread Pools, Actors and the likes of that will be covered.
The document provides an overview of exceptions in Java. It defines errors and exceptions, describes different types of exceptions including checked and unchecked exceptions, and explains key exception handling keywords like try, catch, throw, throws, and finally. The document aims to help programmers better understand exceptions and how to properly handle errors in their Java code.
The document discusses multithreading and threading concepts in Java. It defines a thread as a single sequential flow of execution within a program. Multithreading allows executing multiple threads simultaneously by sharing the resources of a process. The key benefits of multithreading include proper utilization of resources, decreased maintenance costs, and improved performance of complex applications. Threads have various states like new, runnable, running, blocked, and dead during their lifecycle. The document also explains different threading methods like start(), run(), sleep(), yield(), join(), wait(), notify() etc and synchronization techniques in multithreading.
The document discusses exception handling in Java. It defines exceptions as runtime errors that occur during program execution. It describes different types of exceptions like checked exceptions and unchecked exceptions. It explains how to use try, catch, throw, throws and finally keywords to handle exceptions. The try block contains code that might throw exceptions. The catch block catches and handles specific exceptions. The finally block contains cleanup code that always executes regardless of exceptions. The document provides examples of exception handling code in Java.
This document discusses exception handling in Java. It defines an exception as an event that disrupts normal program flow, such as an error. Exceptions are represented by objects that describe the error condition. The document explains Java's exception hierarchy with Throwable at the root and Exception and Error as subclasses. It covers exception handling keywords like try, catch, throw, throws and finally. It provides examples of exception handling code and describes how to define custom exception classes by subclassing Exception.
Do you have what it takes to ace a Java Interview? We are here to help you in consolidating your knowledge and concepts in Java. The following article will cover all the popular Java interview questions for freshers as well as experienced candidates in depth.
Go through all the questions to enhance your chances of performing well in the interviews. The questions will revolve around the basic and core fundamentals of Java.
So, let’s dive deep into the plethora of useful interview questions on Java.
This document discusses key concepts in Java including abstraction, encapsulation, inheritance, polymorphism, and interfaces. It defines these concepts and provides examples. Abstraction hides unnecessary details and shows essential information. Encapsulation wraps data and functions into a single unit. Inheritance allows a subclass to acquire properties of another class. Polymorphism supports method overloading and overriding. Interfaces can be used to implement inheritance between unrelated classes and specify what a class must do without defining how. The document also discusses access specifiers, modifiers, variables, literals, and static and final keywords.
Identifiers in Java refer to variables, methods, classes, packages and interfaces by name rather than being the things themselves. Parameters passed to methods are passed by value. A constructor creates an instance of a class by allocating memory and initializing the object. Packages in Java are used to organize related classes and interfaces and provide access protection.
Java was created in 1991 by James Gosling, Mike Sheridan, and Patrick Naughton at Sun Microsystems. It has three editions: Java ME for limited devices, Java SE as the core platform for desktops and servers, and Java EE for large enterprise applications. Java code is compiled into bytecode that runs on a Java Virtual Machine (JVM) making Java portable across platforms. Key principles of Java include being object-oriented, secure, and platform independent.
Java handles two types of exceptions - unchecked exceptions and checked exceptions. Unchecked exceptions do not need to be handled by programmers, while checked exceptions must be handled. Checked exceptions are environment or server-related issues outside a programmer's control. There are three ways to handle checked exceptions: try-catch blocks, throwing exceptions with the throw keyword, or specifying exceptions with the throws keyword in method signatures. Finally blocks are used to ensure cleanup code executes after try or catch blocks complete.
This document discusses Java exceptions including:
1. The complete try-catch-finally syntax and minimum try-catch syntax.
2. Multilevel catch blocks and the invalid syntax of super-type catch blocks first.
3. The finally block always executes regardless of exceptions and can override return statements.
4. From Java 7, multiple exceptions can be caught in a single catch block.
5. Additional exception facts like the Throwable supertype and checked vs unchecked exceptions.
Mocking allows you to test classes and methods in isolation by replacing their collaborators with mock objects that simulate the normal environment. EasyMock is a framework for creating mock objects that uses a record/replay approach where you first define the expected behavior of mock objects and then replay the code under test to verify it behaves as expected. Mock objects can be normal, strict, or nice depending on how strictly they enforce the expected behavior and order of method calls.
Exception handling in Java allows programs to deal with errors and unexpected conditions gracefully. The try block encloses code that might throw exceptions. When an exception is thrown, the runtime system searches the call stack for a catch block that can handle the exception. The finally block always executes after the try and catch blocks complete to ensure cleanup code runs. Custom exceptions can be created by extending the Exception class.
This document provides an overview of topics that are important to know for Java interviews, including core Java topics like platform independence, wrapper classes, strings, arrays, and enums. It also lists some key differences between Java and C++. The document recommends reviewing these topics in detail as well as watching related tutorial videos to prepare for Java interviews.
1. JIRA can be used to manage the entire project lifecycle from requirements through testing and release.
2. Key aspects that can be configured in JIRA include projects, versions, components, epics, requirements, test cases, sprints, and test execution.
3. Requirements, test cases, and other issue types can be linked together for traceability, and test cases can be organized into test cycles and executed from within JIRA.
The document discusses key concepts related to Java including the Java Virtual Machine (JVM), object-oriented programming principles like abstraction, encapsulation, inheritance and polymorphism, exceptions, and constructors. It provides definitions and explanations of these topics through a series of questions and answers.
The document contains questions and answers related to Java interview questions. It discusses topics like access modifiers, differences between abstract classes and interfaces, garbage collection, constructors vs methods, inheritance, polymorphism, exceptions and more. The questions aim to test the interviewee's understanding of core Java concepts.
C++ provides classes as templates to define common data structures and algorithms. Classes like vector and list define containers that store and retrieve objects through iterators. Iterators allow traversing container elements without knowing details of the underlying data structure. The Standard Template Library contains many useful container and algorithm classes that take advantage of templates and iterators to provide powerful and flexible generic programming capabilities in C++.
1. This document outlines the contents and structure of a book about preparing for Java/J2EE job interviews.
2. It is organized into sections covering Java, Enterprise Java, emerging technologies, sample interview questions, and more.
3. The introduction explains that the book aims to concisely summarize the core concepts needed to succeed in interviews and advance one's career in a time-efficient manner.
The document contains questions and answers related to Cucumber integration with Selenium. It discusses how to integrate Cucumber and Selenium by creating a Maven project and adding the Cucumber dependency. It also addresses the need for a feature file and step definition file to run Cucumber tests and the use of tags to filter scenarios. Finally, it compares Cucumber to other frameworks like JBehave and RSpec.
Data Structure is a way of collecting and organising data in such a way that we can perform operations on these data in an effective way. Data Structures is about rendering data elements in terms of some relationship, for better organization and storage. For example, we have data player's name "Virat" and age 26. Here "Virat" is of String data type and 26 is of integer data type.
We can organize this data as a record like Player record. Now we can collect and store player's records in a file or database as a data structure. For example: "Dhoni" 30, "Gambhir" 31, "Sehwag" 33
In simple language, Data Structures are structures programmed to store ordered data, so that various operations can be performed on it easily.
This document discusses data structures and algorithms. It begins by listing the objectives of understanding data types, abstract data types, data structures, algorithms, addressing methods, mathematical functions used to analyze algorithms, and measuring complexity using time complexity and Big-O notation. It then explains the problem solving process and defines key terms like data type, abstract data type, data structure, algorithm, and addressing methods. Finally, it discusses mathematical functions used in algorithm analysis and measuring an algorithm's complexity.
HTML documents consist of HTML tags and text that are used to structure and markup web page content. HTML tags come in pairs with opening and closing tags, are case insensitive, and always surround element content. The basic structure of an HTML document includes a <head> section for metadata and a <body> section for visible page content.
A database management system (DBMS) is system software for creating and managing databases. The DBMS provides users and programmers with a systematic way to create, retrieve, update and manage data.
A DBMS makes it possible for end users to create, read, update and delete data in a database. The DBMS essentially serves as an interface between the database and end users or application programs, ensuring that data is consistently organized and remains easily accessible.Read more.........
Computer networks have become part of our everyday lives. We use them to take cash from the local ATM. Whenever we send email or browse the Web, we rely on the world’s largest computer network, the Internet, to be our electronic mailman. Telemarketers, usually during dinner hour, use computer networks to sell us their wares. Our cable television stations rely on computer networks to transport programs onto our TV screens. What is a compelling example of their presence in our lives? Without computer networks, our cellular phone is little more than a battery powering-up a meaningless screen. Read more.........
Like most imperative languages in the ALGOL tradition, C has facilities for structured programming and allows lexical variable scope and recursion, while a static type system prevents many unintended operations. In C, all executable code is contained within subroutines, which are called "functions" (although not in the strict sense of functional programming). Function parameters are always passed by value. Pass-by-reference is simulated in C by explicitly passing pointer values. C program source text is free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of statements.
Java data structures for principled programmerspnr15z
This document provides an overview of the 7th edition of a textbook on data structures in Java. It covers object-oriented programming concepts, common data structures like vectors and generics, design fundamentals including complexity analysis and recursion, sorting algorithms, an interface-based design method, and iterators. Each chapter also includes examples and exercises to demonstrate the concepts and techniques.
This document discusses Workday Human Capital Management, a software for managing human resources and talent. It offers features such as talent management, time tracking, payroll solutions, goal and performance management, and succession planning. Pricing is based on a one-time license or subscription model. It supports English and mobile devices like iPhone and iPad. Support options include a knowledge base, online support, and phone support.
Oracle Fusion is enterprise resource planning software applications from Oracle Corporation.
Distributed across various product families, Fusion includes Financial Management, Human Capital Management, Customer Relationship Management, Supply chain management, Procurement, Governance, Project Portfolio.
Workday, Inc. is an on demand (cloud-based) software vendor. Workday features Human Capital Management, Financial Management, and Analytics Applications.
C++ (pronounced "see plus plus") is a computer programming language based on C. It was created for writing programs for many different purposes. In the 1990s, C++ became one of the most used programming languages in the world.
The C++ programming language was developed by Bjarne Stroustrup at Bell Labs in the 1980s, and was originally named "C with classes". The language was planned as an improvement on the C programming language, adding features based on object-oriented programming. Step by step, a lot of advanced features were added to the language, like operator overloading, exception handling and templates.
TOPS Technologies Leading IT Training Institute offer training in Php, .Net, Java, iPhone, Android, Software testing and SEO. By TOPS Technologies. http://www.tops-int.com
Introduction of Object Oriented Programming Language using Java. .pptxPoonam60376
The slide contains the Introduction of Object Oriented Programming Language using Java. It covers basics of OOP, Inheritance,Polymorphism, Exception etc.
Comprehensive JavaScript Cheat Sheet for Quick Reference and Masterypavanbackup22
"This comprehensive JavaScript cheat sheet provides a quick reference guide to essential syntax, functions, and concepts. Perfect for beginners and experienced developers alike, it covers everything from basic data types and operators to advanced topics like closures and async/await. Keep it handy to streamline your coding process and enhance your JavaScript mastery."
JavaScript Cheatsheets with easy way .pdfranjanadeore1
The document provides information about JavaScript keywords and variables, data types, built-in objects, and the DOM. It explains that var, let, and const can be used to declare variables, with var providing function scope, let providing block scope, and const providing block scope and preventing reassignment. The document also summarizes functions, operators, conditional statements, loops, and other core JavaScript concepts.
Java classes and objects are fundamental concepts in object-oriented programming. A class defines the attributes and behaviors of a type of object, acting as a blueprint. An object is an instance of a class, having state stored in fields and behavior through methods. The document provides examples of defining a Dog class with name, breed and color attributes, along with behaviors like barking. It also demonstrates creating Puppy objects, setting fields, and calling methods. Constructors initialize new objects, and classes can contain variables, methods and constructors.
Inheritance allows classes to inherit properties and behaviors from parent classes in Java and C#. Both languages support simple, multilevel, and hierarchical inheritance through the use of extends and implements keywords. Java does not support multiple inheritance directly but allows classes to inherit from one parent class and implement multiple interfaces. Constructors and methods can be called or overridden in subclasses using the super and this keywords respectively.
Top 50 Java Interviews Questions | Tutort Academy - Course for Working Profes...Tutort Academy
Java is one of the most popular programming languages in the world, known for its versatility, portability, and wide range of applications. Java is the most used language in top companies such as Uber, Airbnb, Google, Netflix, Instagram, Spotify, Amazon, and many more because of its features and performance.
This document discusses implementation of inheritance in Java and C#. It covers key inheritance concepts like simple, multilevel, and hierarchical inheritance. It provides examples of inheritance in Java using keywords like extends, super, this. Interfaces are discussed as a way to achieve multiple inheritance in Java. The document also discusses implementation of inheritance in C# using concepts like calling base class constructors and defining virtual methods.
The document discusses inheritance in Java. It defines inheritance as a process where one class acquires properties, methods, and fields of another class. The class that inherits is called a subclass, and the class being inherited from is called a superclass. The extends keyword is used to inherit from a superclass. A subclass inherits all non-private members of its parent class and can define its own methods. The super keyword is used to refer to the superclass members when a subclass defines methods with same names. The document provides code examples to demonstrate inheritance and use of extends and super keywords.
Object- objects have states and behaviors. Example: A dog has states-color, name, breed , as well as behaviors – barking, eating. An object is an instance of a class.
Class- A class can be defined as a template/blue print that describe the behavior/states that object of its type support.
The document provides summaries of key Java concepts like static blocks, constructors, method overriding, the super keyword, method overloading vs overriding, abstract classes vs interfaces, why Java is platform independent, JIT compilers, bytecode, encapsulation, the differences between this() and super(), classes, objects, methods, and constructors in Java. It also answers common interview questions about the main() method, access modifiers, and the differences between C++ and Java.
An interface in Java is a blueprint of a class that defines a standard for what methods a class must include. Interfaces provide full abstraction since none of its methods have a body, while abstract classes provide partial abstraction since they can contain both abstract and concrete methods. Interfaces are used to achieve abstraction and multiple inheritance in Java. Common functionalities can be defined in an interface and implemented differently in classes.
*Metamorphosis* is a biological process where an animal undergoes a dramatic transformation from a juvenile or larval stage to a adult stage, often involving significant changes in form and structure. This process is commonly seen in insects, amphibians, and some other animals.
A measles outbreak originating in West Texas has been linked to confirmed cases in New Mexico, with additional cases reported in Oklahoma and Kansas. The current case count is 795 from Texas, New Mexico, Oklahoma, and Kansas. 95 individuals have required hospitalization, and 3 deaths, 2 children in Texas and one adult in New Mexico. These fatalities mark the first measles-related deaths in the United States since 2015 and the first pediatric measles death since 2003.
The YSPH Virtual Medical Operations Center Briefs (VMOC) were created as a service-learning project by faculty and graduate students at the Yale School of Public Health in response to the 2010 Haiti Earthquake. Each year, the VMOC Briefs are produced by students enrolled in Environmental Health Science Course 581 - Public Health Emergencies: Disaster Planning and Response. These briefs compile diverse information sources – including status reports, maps, news articles, and web content– into a single, easily digestible document that can be widely shared and used interactively. Key features of this report include:
- Comprehensive Overview: Provides situation updates, maps, relevant news, and web resources.
- Accessibility: Designed for easy reading, wide distribution, and interactive use.
- Collaboration: The “unlocked" format enables other responders to share, copy, and adapt seamlessly. The students learn by doing, quickly discovering how and where to find critical information and presenting it in an easily understood manner.
APM event hosted by the Midlands Network on 30 April 2025.
Speaker: Sacha Hind, Senior Programme Manager, Network Rail
With fierce competition in today’s job market, candidates need a lot more than a good CV and interview skills to stand out from the crowd.
Based on her own experience of progressing to a senior project role and leading a team of 35 project professionals, Sacha shared not just how to land that dream role, but how to be successful in it and most importantly, how to enjoy it!
Sacha included her top tips for aspiring leaders – the things you really need to know but people rarely tell you!
We also celebrated our Midlands Regional Network Awards 2025, and presenting the award for Midlands Student of the Year 2025.
This session provided the opportunity for personal reflection on areas attendees are currently focussing on in order to be successful versus what really makes a difference.
Sacha answered some common questions about what it takes to thrive at a senior level in a fast-paced project environment: Do I need a degree? How do I balance work with family and life outside of work? How do I get leadership experience before I become a line manager?
The session was full of practical takeaways and the audience also had the opportunity to get their questions answered on the evening with a live Q&A session.
Attendees hopefully came away feeling more confident, motivated and empowered to progress their careers
"Basics of Heterocyclic Compounds and Their Naming Rules"rupalinirmalbpharm
This video is about heterocyclic compounds, which are chemical compounds with rings that include atoms like nitrogen, oxygen, or sulfur along with carbon. It covers:
Introduction – What heterocyclic compounds are.
Prefix for heteroatom – How to name the different non-carbon atoms in the ring.
Suffix for heterocyclic compounds – How to finish the name depending on the ring size and type.
Nomenclature rules – Simple rules for naming these compounds the right way.
Common rings – Examples of popular heterocyclic compounds used in real life.
Contact Lens:::: An Overview.pptx.: OptometryMushahidRaza8
A comprehensive guide for Optometry students: understanding in easy launguage of contact lens.
Don't forget to like,share and comments if you found it useful!.
How to manage Multiple Warehouses for multiple floors in odoo point of saleCeline George
The need for multiple warehouses and effective inventory management is crucial for companies aiming to optimize their operations, enhance customer satisfaction, and maintain a competitive edge.
Understanding P–N Junction Semiconductors: A Beginner’s GuideGS Virdi
Dive into the fundamentals of P–N junctions, the heart of every diode and semiconductor device. In this concise presentation, Dr. G.S. Virdi (Former Chief Scientist, CSIR-CEERI Pilani) covers:
What Is a P–N Junction? Learn how P-type and N-type materials join to create a diode.
Depletion Region & Biasing: See how forward and reverse bias shape the voltage–current behavior.
V–I Characteristics: Understand the curve that defines diode operation.
Real-World Uses: Discover common applications in rectifiers, signal clipping, and more.
Ideal for electronics students, hobbyists, and engineers seeking a clear, practical introduction to P–N junction semiconductors.
A measles outbreak originating in West Texas has been linked to confirmed cases in New Mexico, with additional cases reported in Oklahoma and Kansas. The current case count is 817 from Texas, New Mexico, Oklahoma, and Kansas. 97 individuals have required hospitalization, and 3 deaths, 2 children in Texas and one adult in New Mexico. These fatalities mark the first measles-related deaths in the United States since 2015 and the first pediatric measles death since 2003.
The YSPH Virtual Medical Operations Center Briefs (VMOC) were created as a service-learning project by faculty and graduate students at the Yale School of Public Health in response to the 2010 Haiti Earthquake. Each year, the VMOC Briefs are produced by students enrolled in Environmental Health Science Course 581 - Public Health Emergencies: Disaster Planning and Response. These briefs compile diverse information sources – including status reports, maps, news articles, and web content– into a single, easily digestible document that can be widely shared and used interactively. Key features of this report include:
- Comprehensive Overview: Provides situation updates, maps, relevant news, and web resources.
- Accessibility: Designed for easy reading, wide distribution, and interactive use.
- Collaboration: The “unlocked" format enables other responders to share, copy, and adapt seamlessly. The students learn by doing, quickly discovering how and where to find critical information and presenting it in an easily understood manner.
CURRENT CASE COUNT: 817 (As of 05/3/2025)
• Texas: 688 (+20)(62% of these cases are in Gaines County).
• New Mexico: 67 (+1 )(92.4% of the cases are from Eddy County)
• Oklahoma: 16 (+1)
• Kansas: 46 (32% of the cases are from Gray County)
HOSPITALIZATIONS: 97 (+2)
• Texas: 89 (+2) - This is 13.02% of all TX cases.
• New Mexico: 7 - This is 10.6% of all NM cases.
• Kansas: 1 - This is 2.7% of all KS cases.
DEATHS: 3
• Texas: 2 – This is 0.31% of all cases
• New Mexico: 1 – This is 1.54% of all cases
US NATIONAL CASE COUNT: 967 (Confirmed and suspected):
INTERNATIONAL SPREAD (As of 4/2/2025)
• Mexico – 865 (+58)
‒Chihuahua, Mexico: 844 (+58) cases, 3 hospitalizations, 1 fatality
• Canada: 1531 (+270) (This reflects Ontario's Outbreak, which began 11/24)
‒Ontario, Canada – 1243 (+223) cases, 84 hospitalizations.
• Europe: 6,814
How to Manage Opening & Closing Controls in Odoo 17 POSCeline George
In Odoo 17 Point of Sale, the opening and closing controls are key for cash management. At the start of a shift, cashiers log in and enter the starting cash amount, marking the beginning of financial tracking. Throughout the shift, every transaction is recorded, creating an audit trail.
This chapter provides an in-depth overview of the viscosity of macromolecules, an essential concept in biophysics and medical sciences, especially in understanding fluid behavior like blood flow in the human body.
Key concepts covered include:
✅ Definition and Types of Viscosity: Dynamic vs. Kinematic viscosity, cohesion, and adhesion.
⚙️ Methods of Measuring Viscosity:
Rotary Viscometer
Vibrational Viscometer
Falling Object Method
Capillary Viscometer
🌡️ Factors Affecting Viscosity: Temperature, composition, flow rate.
🩺 Clinical Relevance: Impact of blood viscosity in cardiovascular health.
🌊 Fluid Dynamics: Laminar vs. turbulent flow, Reynolds number.
🔬 Extension Techniques:
Chromatography (adsorption, partition, TLC, etc.)
Electrophoresis (protein/DNA separation)
Sedimentation and Centrifugation methods.
What makes space feel generous, and how architecture address this generosity in terms of atmosphere, metrics, and the implications of its scale? This edition of #Untagged explores these and other questions in its presentation of the 2024 edition of the Master in Collective Housing. The Master of Architecture in Collective Housing, MCH, is a postgraduate full-time international professional program of advanced architecture design in collective housing presented by Universidad Politécnica of Madrid (UPM) and Swiss Federal Institute of Technology (ETH).
Yearbook MCH 2024. Master in Advanced Studies in Collective Housing UPM - ETH
GDGLSPGCOER - Git and GitHub Workshop.pptxazeenhodekar
This presentation covers the fundamentals of Git and version control in a practical, beginner-friendly way. Learn key commands, the Git data model, commit workflows, and how to collaborate effectively using Git — all explained with visuals, examples, and relatable humor.
1. Java
Interview
Questions
–
www.JavaInterview.in
1
OOPS
Following
picture
show
the
topics
we
would
cover
in
this
article.
What
is
the
super
class
of
every
class
in
Java?
Every class in java is a sub class of the class Object. When we create a class we inherit all the methods
and properties of Object class. Let’s look at a simple example:
String
str
=
"Testing";
System.out.println(str.toString());
System.out.println(str.hashCode());
System.out.println(str.clone());
if(str
instanceof
Object){
System.out.println("I
extend
Object");//Will
be
printed
}
In the above example, toString, hashCode and clone methods for String class are inherited from Object
class and overridden.
Can
super
class
reference
variable
can
hold
an
object
of
sub
class?
Yes. Look at the example below:
Actor reference variables actor1, actor2 hold the reference of objects of sub classes of Animal, Comedian
and Hero.
Since object is super class of all classes, an Object reference variable can also hold an instance of any
class.
2. 2
Java
Interview
Questions
–
www.JavaInterview.in
//Object
is
super
class
of
all
java
classes
Object
object
=
new
Hero();
public
class
Actor
{
public
void
act(){
System.out.println("Act");
};
}
//IS-‐A
relationship.
Hero
is-‐a
Actor
public
class
Hero
extends
Actor
{
public
void
fight(){
System.out.println("fight");
};
}
//IS-‐A
relationship.
Comedian
is-‐a
Actor
public
class
Comedian
extends
Actor
{
public
void
performComedy(){
System.out.println("Comedy");
};
}
Actor
actor1
=
new
Comedian();
Actor
actor2
=
new
Hero();
Is
Multiple
Inheritance
allowed
in
Java?
Multiple Inheritance results in a number of complexities. Java does not support Multiple Inheritance.
class
Dog
extends
Animal,
Pet
{
//COMPILER
ERROR
}
However, we can create an Inheritance Chain
class
Pet
extends
Animal
{
}
class
Dog
extends
Pet
{
}
What
is
Polymorphism?
Refer
to
this
video(https://www.youtube.com/watch?v=t8PTatUXtpI)
for
a
clear
explanation
of
polymorphism.
Polymorphism
is
defined
as
“Same
Code”
giving
“Different
Behavior”.
Let’s
look
at
an
example.
Let’s
define
an
Animal
class
with
a
method
shout.
public
class
Animal
{
public
String
shout()
{
return
"Don't
Know!";
}
3. Java
Interview
Questions
–
www.JavaInterview.in
3
}
Let’s
create
two
new
sub
classes
of
Animal
overriding
the
existing
shout
method
in
Animal.
class
Cat
extends
Animal
{
public
String
shout()
{
return
"Meow
Meow";
}
}
class
Dog
extends
Animal
{
public
String
shout()
{
return
"BOW
BOW";
}
public
void
run(){
}
}
Look
at
the
code
below.
An
instance
of
Animal
class
is
created.
shout
method
is
called.
Animal
animal1
=
new
Animal();
System.out.println(
animal1.shout());
//Don't
Know!
Look
at
the
code
below.
An
instance
of
Dog
class
is
created
and
store
in
a
reference
variable
of
type
Animal.
Animal
animal2
=
new
Dog();
//Reference
variable
type
=>
Animal
//Object
referred
to
=>
Dog
//Dog's
bark
method
is
called.
System.out.println(
animal2.shout());
//BOW
BOW
When
shout
method
is
called
on
animal2,
it
invokes
the
shout
method
in
Dog
class
(type
of
the
object
pointed
to
by
reference
variable
animal2).
Even
though
dog
has
a
method
run,
it
cannot
be
invoked
using
super
class
reference
variable.
//animal2.run();//COMPILE
ERROR
What
is
the
use
of
instanceof
Operator
in
Java?
instanceof operator checks if an object is of a particular type. Let us consider the following class and
interface declarations:
class
SuperClass
{
};
class
SubClass
extends
SuperClass
{
};
4. 4
Java
Interview
Questions
–
www.JavaInterview.in
Java
Interview
Questions
–
www.JavaInterview.in
At
http://www.JavaInterview.in,
we
want
you
to
clear
java
interview
with
ease.
So,
in
addition
to
focussing
on
Core
and
Advanced
Java
we
also
focus
on
topics
like
Code
Reviews,
Performance,
Design
Patterns,
Spring
and
Struts.
We
have
created
more
than
20
videos
to
help
you
understand
these
topics
and
become
an
expert
at
them.
Visit
our
website
http://www.JavaInterview.in
for
complete
list
of
videos.
Other
than
the
videos,
we
answer
the
top
200
frequently
asked
interview
questions
on
our
website.
With
more
900K
video
views
(Apr
2015),
we
are
the
most
popular
channel
on
Java
Interview
Questions
on
YouTube.
Register
here
for
more
updates
:
https://feedburner.google.com/fb/a/mailverify?uri=RithusTutorials
POPULAR
VIDEOS
Java
Interview
:
A
Freshers
Guide
-‐
Part
1:
https://www.youtube.com/watch?v=njZ48YVkei0
Java
Interview
:
A
Freshers
Guide
-‐
Part
2:
https://www.youtube.com/watch?v=xyXuo0y-xoU
Java
Interview
:
A
Guide
for
Experienced:
https://www.youtube.com/watch?v=0xcgzUdTO5M
Collections
Interview
Questions
1:
https://www.youtube.com/watch?v=GnR4hCvEIJQ
Collections
Interview
Questions
2:
https://www.youtube.com/watch?v=6dKGpOKAQqs
Collections
Interview
Questions
3:
https://www.youtube.com/watch?v=_JTIYhnLemA
Collections
Interview
Questions
4:
https://www.youtube.com/watch?v=ZNhT_Z8_q9s
Collections
Interview
Questions
5:
https://www.youtube.com/watch?v=W5c8uXi4qTw
interface
Interface
{
};
class
SuperClassImplementingInteface
implements
Interface
{
};
class
SubClass2
extends
SuperClassImplementingInteface
{
};
class
SomeOtherClass
{
};
Let’s
consider
the
code
below.
We
create
a
few
instances
of
the
classes
declared
above.
5. Java
Interview
Questions
–
www.JavaInterview.in
5
SubClass
subClass
=
new
SubClass();
Object
subClassObj
=
new
SubClass();
SubClass2
subClass2
=
new
SubClass2();
SomeOtherClass
someOtherClass
=
new
SomeOtherClass();
Let’s
now
run
instanceof
operator
on
the
different
instances
created
earlier.
System.out.println(subClass
instanceof
SubClass);//true
System.out.println(subClass
instanceof
SuperClass);//true
System.out.println(subClassObj
instanceof
SuperClass);//true
System.out.println(subClass2
instanceof
SuperClassImplementingInteface);//true
instanceof
can
be
used
with
interfaces
as
well.
Since
Super
Class
implements
the
interface,
below
code
prints
true.
System.out.println(subClass2
instanceof
Interface);//true
If
the
type
compared
is
unrelated
to
the
object,
a
compilation
error
occurs.
//System.out.println(subClass
//
instanceof
SomeOtherClass);//Compiler
Error
Object
referred
by
subClassObj(SubClass)-‐
NOT
of
type
SomeOtherClass
System.out.println(subClassObj
instanceof
SomeOtherClass);//false
What
is
an
Abstract
Class?
An
abstract
class
(Video
Link
-‐
https://www.youtube.com/watch?v=j3GLUcdlz1w )
is
a
class
that
cannot
be
instantiated,
but
must
be
inherited
from.
An
abstract
class
may
be
fully
implemented,
but
is
more
usually
partially
implemented
or
not
implemented
at
all,
thereby
encapsulating
common
functionality
for
inherited
classes.
In
code
below
”AbstractClassExample
ex
=
new
AbstractClassExample();”
gives
a
compilation
error
because
AbstractClassExample
is
declared
with
keyword
abstract.
public
abstract
class
AbstractClassExample
{
public
static
void
main(String[]
args)
{
//An
abstract
class
cannot
be
instantiated
//Below
line
gives
compilation
error
if
uncommented
//AbstractClassExample
ex
=
new
AbstractClassExample();
}
}
How
do
you
define
an
abstract
method?
An Abstract method does not contain body. An abstract method does not have any implementation. The
implementation of an abstract method should be provided in an over-riding method in a sub class.
//Abstract
Class
can
contain
0
or
more
abstract
methods
//Abstract
method
does
not
have
a
body
6. 6
Java
Interview
Questions
–
www.JavaInterview.in
abstract
void
abstractMethod1();
abstract
void
abstractMethod2();
Abstract
method
can
be
declared
only
in
Abstract
Class.
In
the
example
below,
abstractMethod()
gives
a
compiler
error
because
NormalClass
is
not
abstract.
class
NormalClass{
abstract
void
abstractMethod();//COMPILER
ERROR
}
What
is
Coupling?
Coupling is a measure of how much a class is dependent on other classes. There should minimal
dependencies between classes. So, we should always aim for low coupling between classes.
Coupling
Example
Problem
Consider
the
example
below:
class
ShoppingCartEntry
{
public
float
price;
public
int
quantity;
}
class
ShoppingCart
{
public
ShoppingCartEntry[]
items;
}
class
Order
{
private
ShoppingCart
cart;
private
float
salesTax;
public
Order(ShoppingCart
cart,
float
salesTax)
{
this.cart
=
cart;
this.salesTax
=
salesTax;
}
//
This
method
know
the
internal
details
of
ShoppingCartEntry
and
//
ShoppingCart
classes.
If
there
is
any
change
in
any
of
those
//
classes,
this
method
also
needs
to
change.
public
float
orderTotalPrice()
{
float
cartTotalPrice
=
0;
for
(int
i
=
0;
i
<
cart.items.length;
i++)
{
cartTotalPrice
+=
cart.items[i].price
*
cart.items[i].quantity;
}
cartTotalPrice
+=
cartTotalPrice
*
salesTax;
return
cartTotalPrice;
}
}
Method
orderTotalPrice
in
Order
class
is
coupled
heavily
with
ShoppingCartEntry
and
ShoppingCart
classes.
It
uses
different
properties
(items,
price,
quantity)
from
these
classes.
If
any
of
these
properties
change,
orderTotalPrice
will
also
change.
This
is
not
good
for
Maintenance.
7. Java
Interview
Questions
–
www.JavaInterview.in
7
Solution
Consider a better implementation with lesser coupling between classes below: In this implementation,
changes in ShoppingCartEntry or CartContents might not affect Order class at all.
class
ShoppingCartEntry
{
float
price;
int
quantity;
public
float
getTotalPrice()
{
return
price
*
quantity;
}
}
class
CartContents
{
ShoppingCartEntry[]
items;
public
float
getTotalPrice()
{
float
totalPrice
=
0;
for
(ShoppingCartEntry
item:items)
{
totalPrice
+=
item.getTotalPrice();
}
return
totalPrice;
}
}
class
Order
{
private
CartContents
cart;
private
float
salesTax;
public
Order(CartContents
cart,
float
salesTax)
{
this.cart
=
cart;
this.salesTax
=
salesTax;
}
public
float
totalPrice()
{
return
cart.getTotalPrice()
*
(1.0f
+
salesTax);
}
}
What
is
Cohesion?
Cohesion
(Video
Link
-‐
https://www.youtube.com/watch?v=BkcQWoF5124 )
is
a
measure
of
how
related
the
responsibilities
of
a
class
are.
A
class
must
be
highly
cohesive
i.e.
its
responsibilities
(methods)
should
be
highly
related
to
one
another.
8. 8
Java
Interview
Questions
–
www.JavaInterview.in
Example
Problem
Example
class
below
is
downloading
from
internet,
parsing
data
and
storing
data
to
database.
The
responsibilities
of
this
class
are
not
really
related.
This
is
not
cohesive
class.
class
DownloadAndStore{
void
downloadFromInternet(){
}
void
parseData(){
}
void
storeIntoDatabase(){
}
void
doEverything(){
downloadFromInternet();
parseData();
storeIntoDatabase();
}
}
Solution
This is a better way of approaching the problem. Different classes have their own responsibilities.
class
InternetDownloader
{
public
void
downloadFromInternet()
{
}
}
class
DataParser
{
public
void
parseData()
{
}
}
class
DatabaseStorer
{
public
void
storeIntoDatabase()
{
}
}
class
DownloadAndStore
{
void
doEverything()
{
new
InternetDownloader().downloadFromInternet();
new
DataParser().parseData();
new
DatabaseStorer().storeIntoDatabase();
}
}
What
is
Encapsulation?
Encapsulation is “hiding the implementation of a Class behind a well defined interface”. Encapsulation
helps us to change implementation of a class without breaking other code.
9. Java
Interview
Questions
–
www.JavaInterview.in
9
Approach
1
In
this
approach
we
create
a
public
variable
score.
The
main
method
directly
accesses
the
score
variable,
updates
it.
public
class
CricketScorer
{
public
int
score;
}
Let’s
use
the
CricketScorer
class.
public
static
void
main(String[]
args)
{
CricketScorer
scorer
=
new
CricketScorer();
scorer.score
=
scorer.score
+
4;
}
Approach
2
In
this
approach,
we
make
score
as
private
and
access
value
through
get
and
set
methods.
However,
the
logic
of
adding
4
to
the
score
is
performed
in
the
main
method.
public
class
CricketScorer
{
private
int
score;
public
int
getScore()
{
return
score;
}
public
void
setScore(int
score)
{
this.score
=
score;
}
}
Let’s
use
the
CricketScorer
class.
public
static
void
main(String[]
args)
{
CricketScorer
scorer
=
new
CricketScorer();
int
score
=
scorer.getScore();
scorer.setScore(score
+
4);
}
Approach
3
In
this
approach
-‐
For
better
encapsulation,
the
logic
of
doing
the
four
operation
also
is
moved
to
the
CricketScorer
class.
public
class
CricketScorer
{
private
int
score;
public
void
four()
{
score
+=
4;
}
}
Let’s
use
the
CricketScorer
class.
10. 10
Java
Interview
Questions
–
www.JavaInterview.in
public
static
void
main(String[]
args)
{
CricketScorer
scorer
=
new
CricketScorer();
scorer.four();
}
Description
In
terms
of
encapsulation
Approach
3
>
Approach
2
>
Approach
1.
In
Approach
3,
the
user
of
scorer
class
does
not
even
know
that
there
is
a
variable
called
score.
Implementation
of
Scorer
can
change
without
changing
other
classes
using
Scorer.
What
is
Method
Overloading?
A method having the same name as another method (in same class or a sub class) but having different
parameters is called an Overloaded Method.
Example
1
doIt
method
is
overloaded
in
the
below
example:
class
Foo{
public
void
doIt(int
number){
}
public
void
doIt(String
string){
}
}
Example
2
Overloading
can
also
be
done
from
a
sub
class.
class
Bar
extends
Foo{
public
void
doIt(float
number){
}
}
What
is
Method
Overriding?
Creating a Sub Class Method with same signature as that of a method in SuperClass is called Method
Overriding.
Method
Overriding
Example
1:
Let’s
define
an
Animal
class
with
a
method
shout.
public
class
Animal
{
public
String
bark()
{
return
"Don't
Know!";
}
}
Let’s
create
a
sub
class
of
Animal
–
Cat
-‐
overriding
the
existing
shout
method
in
Animal.
class
Cat
extends
Animal
{
public
String
bark()
{
11. Java
Interview
Questions
–
www.JavaInterview.in
1
1
return
"Meow
Meow";
}
}
bark method in Cat class is overriding the bark method in Animal class.
What
is
an
Inner
Class?
Inner
Classes
are
classes
which
are
declared
inside
other
classes.
Consider
the
following
example:
class
OuterClass
{
public
class
InnerClass
{
}
public
static
class
StaticNestedClass
{
}
}
What
is
a
Static
Inner
Class?
A
class
declared
directly
inside
another
class
and
declared
as
static.
In
the
example
above,
class
name
StaticNestedClass
is
a
static
inner
class.
Can
you
create
an
inner
class
inside
a
method?
Yes.
An
inner
class
can
be
declared
directly
inside
a
method.
In
the
example
below,
class
name
MethodLocalInnerClass
is
a
method
inner
class.
class
OuterClass
{
public
void
exampleMethod()
{
class
MethodLocalInnerClass
{
};
}
}
Constructors
Constructor (Youtube Video link - https://www.youtube.com/watch?v=XrdxGT2s9tc ) is
invoked whenever we create an instance(object) of a Class. We cannot create an object without a
constructor. If we do not provide a constructor, compiler provides a default no-argument constructor.
What
is
a
Default
Constructor?
Default Constructor is the constructor that is provided by the compiler. It has no arguments. In the
example below, there are no Constructors defined in the Animal class. Compiler provides us with a
default constructor, which helps us create an instance of animal class.
public
class
Animal
{
String
name;
public
static
void
main(String[]
args)
{
12. 12
Java
Interview
Questions
–
www.JavaInterview.in
//
Compiler
provides
this
class
with
a
default
no-‐argument
constructor.
//
This
allows
us
to
create
an
instance
of
Animal
class.
Animal
animal
=
new
Animal();
}
}
How
do
you
call
a
Super
Class
Constructor
from
a
Constructor?
A constructor can call the constructor of a super class using the super() method call. Only constraint is
that it should be the first statement i
Both example constructors below can replaces the no argument "public Animal() " constructor in Example
3.
public
Animal()
{
super();
this.name
=
"Default
Name";
}
Can
a
constructor
be
called
directly
from
a
method?
A constructor cannot be explicitly called from any method except another constructor.
class
Animal
{
String
name;
public
Animal()
{
}
public
method()
{
Animal();//
Compiler
error
}
}
Is
a
super
class
constructor
called
even
when
there
is
no
explicit
call
from
a
sub
class
constructor?
If a super class constructor is not explicitly called from a sub class constructor, super class (no argument)
constructor is automatically invoked (as first line) from a sub class constructor.
Consider the example below:
class
Animal
{
public
Animal()
{
System.out.println("Animal
Constructor");
}
}
class
Dog
extends
Animal
{
public
Dog()
{
System.out.println("Dog
Constructor");
}
}
class
Labrador
extends
Dog
{
public
Labrador()
{
System.out.println("Labrador
Constructor");
}
13. Java
Interview
Questions
–
www.JavaInterview.in
1
3
}
public
class
ConstructorExamples
{
public
static
void
main(String[]
args)
{
Labrador
labrador
=
new
Labrador();
}
}
Program
Output
Animal Constructor
Dog Constructor
Labrador Constructor
Interface
What
is
an
Interface?
An interface (YouTube video link - https://www.youtube.com/watch?v=VangB-sVNgg ) defines
a contract for responsibilities (methods) of a class.
How
do
you
define
an
Interface?
An
interface
is
declared
by
using
the
keyword
interface.
Look
at
the
example
below:
Flyable
is
an
interface.
//public
abstract
are
not
necessary
public
abstract
interface
Flyable
{
//public
abstract
are
not
necessary
public
abstract
void
fly();
}
How
do
you
implement
an
interface?
We can define a class implementing the interface by using the implements keyword. Let us look at a
couple of examples:
Example
1
Class
Aeroplane
implements
Flyable
and
implements
the
abstract
method
fly().
public
class
Aeroplane
implements
Flyable{
@Override
public
void
fly()
{
System.out.println("Aeroplane
is
flying");
}
}
Example
2
public
class
Bird
implements
Flyable{
@Override
public
void
fly()
{
System.out.println("Bird
is
flying");
}
}
14. 14
Java
Interview
Questions
–
www.JavaInterview.in
Can
you
tell
a
little
bit
more
about
interfaces?
Variables
in
an
interface
are
always
public,
static,
final.
Variables
in
an
interface
cannot
be
declared
private.
interface
ExampleInterface1
{
//By
default
-‐
public
static
final.
No
other
modifier
allowed
//value1,value2,value3,value4
all
are
-‐
public
static
final
int
value1
=
10;
public
int
value2
=
15;
public
static
int
value3
=
20;
public
static
final
int
value4
=
25;
//private
int
value5
=
10;//COMPILER
ERROR
}
Interface
methods
are
by
default
public
and
abstract.
A
concrete
method
(fully
defined
method)
cannot
be
created
in
an
interface.
Consider
the
example
below:
interface
ExampleInterface1
{
//By
default
-‐
public
abstract.
No
other
modifier
allowed
void
method1();//method1
is
public
and
abstract
//private
void
method6();//COMPILER
ERROR!
/*//Interface
cannot
have
body
(definition)
of
a
method
//This
method,
uncommented,
gives
COMPILER
ERROR!
void
method5()
{
System.out.println("Method5");
}
*/
}
Can
you
extend
an
interface?
An interface can extend another interface. Consider the example below:
interface
SubInterface1
extends
ExampleInterface1{
void
method3();
}
Class
implementing
SubInterface1
should
implement
both
methods
-‐
method3
and
method1(from
ExampleInterface1)
An interface cannot extend a class.
/*
//COMPILE
ERROR
IF
UnCommented
//Interface
cannot
extend
a
Class
interface
SubInterface2
extends
Integer{
void
method3();
}
*/
Can
a
class
extend
multiple
interfaces?
15. Java
Interview
Questions
–
www.JavaInterview.in
1
5
A class can implement multiple interfaces. It should implement all the method declared in all Interfaces
being implemented.
interface
ExampleInterface2
{
void
method2();
}
class
SampleImpl
implements
ExampleInterface1,ExampleInterface2{
/*
A
class
should
implement
all
the
methods
in
an
interface.
If
either
of
method1
or
method2
is
commented,
it
would
result
in
compilation
error.
*/
public
void
method2()
{
System.out.println("Sample
Implementation
for
Method2");
}
public
void
method1()
{
System.out.println("Sample
Implementation
for
Method1");
}
}
POPULAR
VIDEOS
Java
Interview
:
A
Freshers
Guide
-‐
Part
1:
https://www.youtube.com/watch?v=njZ48YVkei0
Java
Interview
:
A
Freshers
Guide
-‐
Part
2:
https://www.youtube.com/watch?v=xyXuo0y-xoU
Java
Interview
:
A
Guide
for
Experienced:
https://www.youtube.com/watch?v=0xcgzUdTO5M
Collections
Interview
Questions
1:
https://www.youtube.com/watch?v=GnR4hCvEIJQ
Collections
Interview
Questions
2:
https://www.youtube.com/watch?v=6dKGpOKAQqs
Collections
Interview
Questions
3:
https://www.youtube.com/watch?v=_JTIYhnLemA
Collections
Interview
Questions
4:
https://www.youtube.com/watch?v=ZNhT_Z8_q9s
Collections
Interview
Questions
5:
https://www.youtube.com/watch?v=W5c8uXi4qTw