can anyone give me an explanation about static class in java
A static class is one whose variables and methods can be called(invoked) without the class being instantiated,every other class has to be instantiated before its methods/variables can be invoked
hi thanks for your reply, can you please give me the clear picture of it, u mean to say that if u access any method or variables without the class being instantiated then that class is referred as static.
can u tell me that the main class is static or not
static in simple words means that we are not able to use instance variables(the class variabes)which don't have the word static in the main method or invoking other methods those don't have the word static also in the main method.
you will ask me why??
I will tell you that because the main method has the word static.
you will tell me I don't understand ,..ok fine look at this now, you can create an object in the same class you are working with in the main method to call the methods that don't have the word static by this statment ( object name.metthod name) you will notic that the program runs without any problem why because of the object you created also you can use in the main method the class variables that don't have the word static by (object name . class variable) why again because of the object. however the methods those don't have the word static they are able to use the variable class because they don't have the word static.so what does static mean? it means that no need to create the object as long as both the method and class variables share the same word static
also it means that no need to create object as long as the two methods are static(the first calls the other by mentioning the function name)
hope you understand .
please reply me if not.
ya i got it, u mean to say that in static class , no need to instantiate an object until the variable and methods are declared as static
Thanks a million
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...