Adisesha Rao Raya

Greenhorn
+ Follow
since Apr 08, 2005
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 Adisesha Rao Raya

Hi Niranjan,
Thanks to remind good thing. I am sorry to forgot to metion the experience and preparation i did for the exam.

I am an Employee working in a reputed Organization. I entered the organization which has developed sophisticated products on java with advanced concepts like web services.I am a novice to java at the time i joined the company. By taking the help of senior collegues i decided to become profiency in java with in at least 3 to 6 months.For that to understand and become expert in java i chose the SUN Carrer path.

I started preparing java as follows.

1. read the java tutorial to get basic functionality and concepts.
2. start reading A Programers Guide to Java by khalid moghal to get concepts in a great deal.
3. I attempted tests in danchisom site in the study guide2 which people feel hardest than SCJP exam.
4. I identified my week areas by completed that study guide tests.
5. I started reading K&B book. I prefered to all this is the book for SCJP. I got in depth knowledge after finishing the K & B book. This book explains the areas where people often do mistakes and confuse in the exam.
6. I started attempting the mock tests from different sites which java ranchies provides.After i got confidence that i can pass the exam i tried to read again areas where i am making mistakes in the exam.I learned lot of solutions from this great site.
7. My last week journey as

attempt marcus green's 4 mock tests i got 80% on avarage of 4 tests. I tried simulators from the sources of internet. On the last day i have taken Khalid mogal and K&B mock tests. I got 80% in both tests.
8. On the exam day i had a look at the khalid moghal book once to each chapter and gone through exam watch and two minute drill from k&B. Two minute drill is very important to see on the exam day.

So by the help of all your ranchies i suceed finally with the out come of 83%.
Thanks to one and all who involved in this heaven(forum)

Regards
seshu -SCJP 1.4
16 years ago
Thanks to all java ranchies and forum modarators for your valuable support. Wish You A Happy New Year
16 years ago
Hi,
If you want to use more than one class in one file, specify the class that you want to give the name same as file name (which contains main()) as public specifier.Give other class names with out public specifier.If you provide public specifier with class name the compiler forces you give only one class in one file.
In your example remove public specifier to your MyObject class. Then it will run fine.

Regards
Seshu
17 years ago
I am giving the solution for your problem from my prospective of understanding. if it helps you i am very much glad


import java.io.*;
class testParse
{
String a = "";
String str;
public String readXML()
{
StringBuffer stBuf= new StringBuffer();
try
{
File fileToRead = new File( "c:/account.xml" );
RandomAccessFile raf = new RandomAccessFile( fileToRead, "r" );
while ((str=raf.readLine()) != null)
{
stBuf.append(str);
System.out.println(str);
}
}
catch(Exception e)
{}
stBuf.toString();
return str;
}

int parse(String str)
{
int ON = 1;

try
{
a = str;

int PacketLength=a.lastIndexOf(">");
System.out.println(PacketLength);
}
catch(Exception e)
{}
return ON;
}

public static void main(String args[])
{
testParse p = new testParse();
String st = p.readXML()
p.parse(st);
}
}

In your previous program str in readXML() is returning null because of out of scope(i think).Thats why you are getting -1 as string length.
Thanks
Seshu
17 years ago
You are trying to call constructor with new homer(num) in the main().
But constructor should not contain return type and static.
so modify the class as below

class homer
{
public homer(int n)
{
System.out.print(n);

System.out.print("," + n);
}

public static void main(String[] args)
{
int num = Integer.parseInt(args[0]);
new homer(num);
}
}
17 years ago
Hi,
I can suggest the solution as

boolean bResult = new Boolean(request.getParameter("active")).booleanValue();

The constructor converts the string value as boolean object based on the String value true/false.

We can get the primitive data type from the boolean object by using booleanValue().

If this helps you i am very happy else i will learn better solution from you

Thanks and Regards
Adisesha Rao
17 years ago
JSP