Find the best tutors and institutes for Java Training

Find Best Java Training Classes

Please select a Category.

Please select a Locality.

No matching category found.

No matching Locality found.

Outside India?

Search for topics

Why do we use static keywords in Java?

Asked by Last Modified  

IT Courses/Java

Follow 0
Answer

3 Answers

Please enter your answer

Software Engineer

Lets take a example you wanted to create a record of 100 student. class student { int roll_no; String name; String college_name; } so while creating 100 object of student class the student's college name will be common but in upper define class the college_name will also will be created... read more
Lets take a example you wanted to create a record of 100 student. class student { int roll_no; String name; String college_name; } so while creating 100 object of student class the student's college name will be common but in upper define class the college_name will also will be created 100 times which is unnecessary and memory wastage. By declaring the college_name as static (static String college_name) only one copy of college_name will be created because only one copy of each static variable being created at class level. read less
Comments

The static keyword in Java means that the variable or function is shared between all instances of that class as it belongs to the type, not the actual objects themselves
Comments

Tutor

You need to understand the static vs normal ... When you defined a variable static then that variable will be shared across all the objects of the class... but the normal variable is associated with the object and it's different for different objects....Rest u can see here . https://www.javatpoint.co... read more
You need to understand the static vs normal ... When you defined a variable static then that variable will be shared across all the objects of the class... but the normal variable is associated with the object and it's different for different objects....Rest u can see here . https://www.javatpoint.com/static-keyword-in-java read less
Comments

View 1 more Answers

Related Lessons


Class and Objects in Java
Class is a template or a blueprint which is used to describe an object. On other hand Object is a reference of a class which follows all the stuff written inside the class. How about taking the whole tour in the following video

Kalyani Jawade | 31/10/2018

1 0
0

Class and Objects in Java
Class is a template or a blueprint which is used to describe an object. On other hand Object is a reference of a class which follows all the stuff written inside the class. How about taking the whole tour in the following video

Kalyani Jawade | 31/10/2018

1 0
0

Recommended Articles

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to write once, run anywhere (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Before we start on the importance of learning JavaScript, let s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

Looking for Java Training Classes?

Find best Java Training Classes in your locality on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you

Find Best Java Training Classes?

Find Now »

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 25 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 6.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more