UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Why do we use static keywords in Java?

Asked by Last Modified  

3 Answers

Learn Java

Follow 0
Answer

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 Questions

Hi sir, I'm confused between .net and java. What to choose for a career. I have little bit knowledge of asp.net. Please guide me for this. Thank you
Hello Kirit, The application which were devloped about 2 decades back was mostly coded in java and so you will see so many of the application (in several company and outside) written in java. .Net(collectively...
Kirit
Which language has the best future prospects: Python, Java, or JavaScript?
According to me, "Python" is the programming language having the best future prospect considering the current industry trend. Reason: Python is extensively used in advanced technologies such as Machine...
Atharva
0 0
5
Why is finally introduced in Java?
Finally is introduced in Java to do the code clean up or if you wants to perform some operation irrespective of whether the code throws an Exception or not.
Agastya

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

doWhile example in Java
public class doWhilePracticleEx { public void test() { } public static void main(String args) { String q1 = "Who is PM of India?"; String a1 = "Sonia Gandhi"; String a2 = "Rahul Gandhi"; String a3...
S

Sarthak C.

0 0
0

How to create excel sheets using Java?
HSSFWorkbook workbook = new HSSFWorkbook();HSSFSheet sheet1 = workbook.createSheet("actions");for (int i = 0; i < 10; i++) { sheet1.createRow(i); for (int j = 0; j < 10; j++) { HSSFRow currRow =...

Access Specifiers â?? Private, Protected, Public, Package-private
Access level modifiers determine whether other classes can use a particular field or invoke a particular method. The following table shows the access to members permitted by each modifier. Access...

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

Java 8 Predicates
In the previous lession, we have learnt how to use filters and collectors. In filter we have passed the condition to evaluate whether the object is eligible to be filtered or not. Code given below for...

Recommended Articles

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

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 >

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 >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 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 7.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