Hello,
I have just completed studying core java using the book "The Complete Reference Java 7th edition" by Herbert Schildt.
I now wanted to start gaining knowledge in Java 2 Enterprise...
Type: Posts; User: rohan22
Hello,
I have just completed studying core java using the book "The Complete Reference Java 7th edition" by Herbert Schildt.
I now wanted to start gaining knowledge in Java 2 Enterprise...
So sorry......Thanks anyways.......
By the way any help to my question
As i said here is certain changes to your queries
1)methodUser.nonStaticMethod();.............. works fine.
2)methodUser.staticMethod();...............you can simply call as...
If you want a particular method of a class (w.r.t its access specifiers) to be called, without creating an object of that class we usually make it as static.
But on the other hand if you want a...
Use static variables. They are class variables.You will always get updated values when they are altered between methods of different classes.
Hello ,
I want to start gaining knowledge about the Java EE. Right now i have a book called Java Server programming J2EE 1.4 Black book Platinium edition by Kogent Solutions Inc from Dreamtech...
Cool............ thanks.....
Yes i got to know that m is int and not static int in netbeans debugger when i review the contents of m.
But my question was can static methods have non static variables also.And yes i can...
Yes I have tried and its working Fine.Try the below code:
class D {
int k;
void fill(int g) {
k = g;
System.out.println("k is " + k);
I think i am very close to solving it.Just tell me one thing.Now(below i have written a short code about
the scenario) suppose if i have a static method X(). And in that if i declare a variable...
Hey....For my first program, to access Stack3 class i have created an object called stackcopy and accessing an nonstatic method push(int ele) from main() of Doubt1 class.And in my second program...
Hello,
Below is my code for Stack implementation.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package doubt1;
I am extremely Sorry......
Hello Rakesh !
Below is the code i have written it for you.......Hope it meets your requirement.
...edited by moderator
Let me know if you require any changes....Happy coding:cool:
Awesome..... thanks a lot.....But we are back to the square in giving the answer....."the JLS says so....".Yes i agree not much information
is available on net on this topic.But will keep the...
Yea i got your point.....As in java if we don't specify with any access specifier its package protected.I totally agree with you.
Coming back to my piece of code:-
class Helloworld{
public static...
If main doesn't work without public then I assume there must be valid reason for it to be public.Something related to its syntax specification.
Anyways thanks a lot. Like you my search for this is...
Hey please let me know the reason.....it would be great.......! else this question will start eating my until I am convienced....
Thanks a lot
Considering a simple Helloworld program
class Helloworld{
public static void main(String args[]){
System.out.println("This is Hello World Program");
...
Hey thanks for ur timely reply(Ya i will do it like u said for command prompt copying....sorry for putting up an image).
But my problem is unsolved.Why should i once again say java In2.Bwoi after...
Here is the following scenario
my classpath in environment variables is .;D/Javarohan; (current directory already specified)
my files are in location D:/Javarohan/In2
Filename in In2...
Hi all,
Cant we use System.out.println within class scope ? Like the one shown below:
class A{
int a=1;
System.out.println(" a is " +a); //giving error ... understandable...
Hi,
In structured programming language like c we could create a method in main().In java its not possible.Why? Or is there any way we can create a method in main using keywords like static or...
Yea..! got it.
Thanks friend for your solution.Yea its too confusing to visualize this concept.But most importantly by using a superclass variable
to reference a subclass object we are just explaining the code to...