A Java package is a set of classes which are grouped together. This grouping helps to organize Java classes and interfaces classes with the same name. A package provides a unique namespace for the types it contains. Classes in the Read More …
Blog
(b) Explain followings in context of java, with the help of examples.
(i) Class and objects (ii) Abstraction and encapsulation (iii) Application program and applet program Class and object A class is a blueprint that describes characteristics and functions of entity.. For example, the class Dog would consist of traits shared by Read More …
Explain the need of package in Java. Explain accessibility rules for packages.
Package in Java is a mechanism to encapsulate a group of classes, sub packages and interfaces.Advantages of using a Package in JavaReusability – While developing a project in java, we often feel that there are few things that we are writing Read More …
Explain use of static methods in java.
A static method belongs to the class rather than the object of a class. A static method can be accessed directly by the class name and doesn’t need any object. A static method can access static data member and can Read More …
What is layout manager? Describe use of flow layout and grid layout with the help of
program code.
Layout Manager: The Layout managers enable us to control the way in which visual components are arranged in the GUI forms by determining the size and position of components within the containers. Java – Flow Layout Flow layout is the default Read More …
What is exception? What are different types of exceptions? Explain need of exceptions
handling with the help of a program.
Exception: When an error occurs within a method, the method creates an object and hands it off to the runtime system. The object, called an exception object, contains information about the error, including its type and the state of the program Read More …
What is polymorphism? Explain use of polymorphism in java programming
Polymorphism: Polymorphism is considered one of the important features of Object-Oriented Programming. Polymorphism allows us to perform a single action in different ways. In other words, polymorphism allows you to define one interface and have multiple implementations. The word “poly” Read More …
Explain use(s) of following keywords of Java with the help of program/example: final
Java final keyword In Java, the final keyword is used to denote constants. It can be used with variables, methods, and classes. Once any entity (variable, method or class) is declared final, it can be assigned only once. That is, the final variable Read More …
Describe features of Java programming language
The prime reason behind creation of Java was to bring portability and security feature into a computer language. Beside these two major features, there were many other features that played an important role in moulding out the final form of Read More …
Explain different data types available in Java.
Data Types in Java Data types specify the different sizes and values that can be stored in the variable. There are two types of data types in Java: Primitive data types: The primitive data types include boolean, char, byte, short, Read More …