answersLogoWhite

0

What is meant by a class in java programming?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

Class - A class can be defined as a template/ blue print that describe the behaviors/states that object of its type support.

Classes in Java:A class is a blue print from which individual objects are created.

A sample of a class is given below: public class Dog{ String breed; int age; String color; void barking(){ } void hungry(){ } void sleeping(){ } }

A class can contain any of the following variable types.

  • Local variables . variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and the variable will be destroyed when the method has completed.

  • Instance variables . Instance variables are variables within a class but outside any method. These variables are instantiated when the class is loaded. Instance variables can be accessed from inside any method, constructor or blocks of that particular class.

  • Class variables . Class variables are variables declared with in a class, outside any method, with the static keyword.

A class can have any number of methods to access the value of various kind of methods. In the above example, barking(), hungry() and sleeping() are variables.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is meant by a class in java programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is meant by java API and how it is helpful to the java programmer?

API stands for Application Programming Interface It usually referrs to documentation on how a specific class works. It lists,describes, and details the class' methods, properties, constructors, etc.. Here is a link for a the API of the String class in Java: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html


How can we make sure (pragmatically) that a class will have no further child classes. Which programming stmt will do this in Java and C?

How can we make sure (pragmatically) that a class will have no further child classes. Which programming stmt will do this in Java and C++?


Is the best institute for learn java programming in Pakistan?

The Java programming language is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. Then you learn java programming language in Pakistan get the best java programming classes at the lowest cost.


What is meant by lightweight in java?

LIght Weight Programming means the coding should be small .


How many constructor can be defined in a classin java p rogramming?

how many constructer can be defined in class in overloading of java programming


What is Date class in java?

i am management student,and want to know answer that ,what is date class in java?


What is meant by class in java?

class is an important element of an oop. class is a user defind data type.


What is FileReader?

In java FileReader is a class which is meant for reading streams of characters.


What command executes the Java class file Welcomeclass?

I assume you meant Welcome.class, in which case, it would be: java Welcome


What is abstraction method in java?

Abstraction in Java or Object oriented programming is a way to segregate implementation from interface and one of the five fundamentals along with Encapsulation, Inheritance, Polymorphism, Class and Object. Abstraction in Java is achieved by using interface and abstract class in Java.


How oops concept is implemented in java?

OOP stands for Object Oriented Programming. Everything in Java is an Object. Any class you create extends the Object class by default thereby making everything in Java an object. Moreover, you can use features like Inheritance, Polymorphism, Encapsulation etc which are OOP concepts thereby making Java an Object Oriented Programming Language


What is math in java programming?

The java. lang. math class allows for the use of many common mathematical functions that can be used while creating programs