Win a copy of Terraform in Action this week in the Cloud forum!

Syed Naimathullah

Greenhorn
+ Follow
since Feb 18, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Syed Naimathullah

Hello Ranchers,

I have Cleared SCJP5.0 with 63%.This is not a good score but iam happy that i have cleared it.

Can anybody tell me what is the process of getting logo of Certified person,and in how many days will i get the certificate from SUN.

14 years ago
it is giving compile time error at line 1,5

class MCZ11 {
public static void main (String[] args) {
char a = '\c'; //line 1
char b = '\r';
char c = '\"';
char d = '\b';
char e = '\p'; //line 5
}}
please explain me why
please give me clear detail about the equals method and the "==" with a program and output explanation
1: if( new Boolean("true") == new Boolean("true"))
2: System.out.println("True");
3: else
4: System.out.println("False");

explain the program and output
program from mock exam java belt
explain program in full detail

01: class MyClass {
02: static int maxElements;
03:
04: MyClass(int maxElements) {
05: this.maxElements = maxElements;
06: }
07: }
08:
09: public class Q19 {
10: public static void main(String[] args) {
11: MyClass a = new MyClass(100);
12: MyClass b = new MyClass(100);
13:
14: if (a.equals(b))
15: System.out.println("Objects have the same values");
16: else
17: System.out.println("Objects have different values");
18: }
19: }

i thought the output will be
Prints "Objects have the same values"
but the output is "Objects have different values"
program from mock exam java belt
explain program in full detail

01: class MyClass {
02: static int maxElements;
03:
04: MyClass(int maxElements) {
05: this.maxElements = maxElements;
06: }
07: }
08:
09: public class Q19 {
10: public static void main(String[] args) {
11: MyClass a = new MyClass(100);
12: MyClass b = new MyClass(100);
13:
14: if (a.equals(b))
15: System.out.println("Objects have the same values");
16: else
17: System.out.println("Objects have different values");
18: }
19: }

i thought the output will be
Prints "Objects have the same values"
but the output is "Objects have different values"
Hello ranchers,

I have one week for the exam,and i am not able to get good score so what should i do.I have read K&b 2 times but iam not able to get the flow of the programs.My percentage of mock exams are around is 50 - 55%.
How program flow is going on please explain in detail

import java.awt.Dimension;
class ReferenceTest1
{
public static void main(String[] args)
{
Dimension d=new Dimension(5,10);
ReferenceTest1 rt=new ReferenceTest1();
System.out.println("Before modify() d.height="+d.height);
rt.modify(d);
System.out.println("After modify() d.height="+d.height);
}
void modify(Dimension dim)
{
dim.height=dim.height+1;
System.out.println("dim="+dim.height);

}
}
How program flow is going can any body explain me in detail .



class ReferenceTest
{
public static void main(String[] args)
{
int a=1;
ReferenceTest rt=new ReferenceTest();
System.out.println("Before modify() a="+a);
rt.modify(a);
System.out.println("After modify() a="+a);
}
void modify(int number)
{
number=number+1;
System.out.println("number="+number);
}}
can anybody explain me the working of this program........?

class Top{
public Top(String s)
{
System.out.print("B");
}
}

public class Bottom2 extends Top
{
public Bottom2(String s)
{
System.out.print("D");
}

public static void main(String[] args)
{
new Bottom2("C");
System.out.println(" ");
}
}


The output is :"compilation fails".
Iam not able to understand how does the above output comes( ).
Thank you for replying , the above two answers are the best answers for me.

Thank you once again
can you explain me the output in detail:

class Red {
public int a;
public static int b;
public static void main (String[] in) {
Red r1 = new Red();
Red r2 = new Red();
r1.a++;
r1.b++;
System.out.print(r1.a+", "+r1.b+", "+r2.a+", "+r2.b);
}
}

output:1,1,0,1

How does this output comes?explain
Hi friends, can you just explain what "equals" and "instanceof" used for.what is the difference between them.
14 years ago
Can their be a static variable in a inner class?
can a inner class have static variable?
can someone explain about"Method local inner class"?