This week's book giveaway is in the JDBC and Relational Databases forum.
We're giving away four copies of Resilient Oracle PL/SQL: Building Resilient Database Solutions for Continuous Operation and have Stephen Morris on-line!
See this thread for details.

Mahesh Kumaraguru

Ranch Hand
+ Follow
since Jun 01, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mahesh Kumaraguru

Roel De Nijs wrote:

Michael Clare wrote:From what I can tell, the least expensive way to fulfill the course requirement is the Java SE 7 New Features self-study at $710 US.

Can anyone please suggest if there is a less expensive alternative way to fulfill the course requirement?

Unfortunately the self-study CD will not fulfill the training requirement.

On this page you'll find the following quote:

Step 2 - Complete one of these courses. wrote:Courses can be instructor-led in-class (ILT), a live virtual class (LVC), training on demand (TOD), or Unlimited Learning Subscription. Self-study CD and online courses are great preparation tools, but do not fulfill the training requirement.

Hope it helps!
Kind regards,

I just now completed "Object oriented Analysis and Design using UML Ed 2" which satisfies the prerequisite requirement for OCMJD (previously SCJD).

I plan to register for OCMJD / SCJD soon.
What layout would you like to use? ~ Mahesh
7 years ago
I have experience with Swing and I am new to JavaFX. I am planning to appear for Developer Certification (SCJD/OCMJD). Is the project work to be done using Swing or JavaFX or is it the developers choice ?

Thanks and Regards,
K. Mahesh

Campbell Ritchie wrote:Maybe, but how did you work it for ints?


char[] charsInNumberToSearch = (Integer.toString(numberToSearch)).toCharArray();

Then did a char by char comparision and incremented a counter.
7 years ago

Campbell Ritchie wrote:
That was to operate on numbers using the == operator. It is completely unnecessary to use Strings and char[] arrays, unless possibly to get rid of the problem of having negative numbers.

I thought of a generic solution that would work with String, float, double, int and long, maybe using overloaded methods.
7 years ago

deepak kumarsharma wrote:yeah i m looking for a core java project...@Mahesh Kumaraguru

I am new to android technology... so it will take time to build a project in android and I don't have that much time @ Marc Laffan

Can you help me with the source codes of the project...i will learn them and try if i could invent something different from that...

and thank you...

@Deepak KumarSharma

There are many +ives and -ives you have to consider before deciding on Android versus Core Java project. When you complete your Computer engineering course work and "Enter the market" with your resume / CV / skill set, the biggest work you would show and what employers would be interested to know would be the project you did as part of the final year course work of your computer engineering degree.

Android has a very high job market value compared to Java because Java is a saturated market: - Sun Microsystems released the first public implementation as Java 1.0 in 1995 "Since 1995, Java has changed our world . . . and our expectations.."

Think of "selling yourself to your prospective employer" (please do not get any wrong meaning of the word "sell").

Android Job Trends

What are the career prospects for an Android application developer?

Android developers see a healthy job market, excellent salaries in 2013 and beyond (October 11, 2013)

How to Be a Highly Competitive Mobile Developer (Sep 01, 2014)

Android has been called "The Best Mobile Platform so far" and quoted from one of the above links "First if you're a Java Developer by heart then you can dive in to Android no doubt about that, just study the framework, development steps, read stuff at"

If you are keen on doing a non Android Java project (core Java + Swing / Java FX + File IO | DB | ORM), I can post you more details.

Best of luck in your Android versus Java debate, talk your project guide / professor.
7 years ago

A very similar algorithm would work for finding the number of occurrences of a char within a String.

Note: - I posted a complete solution which did not show up in the replies, the message I got from JavaRanch staff was "attention required: your post requires editing before being shown in the forums / Please don't provide complete solutions.". So I am editing this post and converted part of it to pseudo code, maybe this policy is in place to "force" members to "learn Java" :-) Hoping the above "pseudo code + code" meets the JavaRanch posting standard.
7 years ago

deepak kumarsharma wrote:Hello folks, I just Entered into my Final year of computer Engineering...We have to build a project but I aint getting any idea...Can anyone suggest me a good project in java...i m done with core java and I have also worked on Vaadin...

Are you looking for an Android project or a Core Java project ?
7 years ago
Input file is

C:\Users\Public\Documents\JavaTestFiles\employees.txt is is

Employee,java is

Outputs are

Enter the Employee number you would like to search:
Searching for Employee with ID = 0
Employee with id 0 not found
BUILD SUCCESSFUL (total time: 5 seconds)

Enter the Employee number you would like to search:
Searching for Employee with ID = 2345
Employee ID = 2345, Salary = 987654.32, Name = Deepti Chansouria
BUILD SUCCESSFUL (total time: 6 seconds)
7 years ago

Campbell Ritchie wrote:Have you worked out why you are getting the stack overflow?

In line 5 of

A a = new A();

leads to creation of a new instance of A (lets call it instance 1) by calling constructor of A(). The class in line 4 creates a new instance of A (lets call it instance 2) to which it holds a reference in instance variable a. When creating an new instance (what we called instance 2) in line 4 of, the newly created instance 2 creates another new instance of A by calling constructor of A() which is instance 3 and so on... Thus when an instance "n" of A is created it will create a new instance "n+1" of A calling the constructor of A(). This leads to infinite recursion, that's the reason for java.lang.StackOverflowError. This is like a recursive function which does not properly return, only here its a constructor call which keeps on infinitely calling itself.
7 years ago
I created two classes


There are no compile time errors. Running it in NetBeans IDE gave

Exception in thread "main" java.lang.StackOverflowError
at com.javaranch.mahesh.testclassinstantiation.A.<init>(
at com.javaranch.mahesh.testclassinstantiation.A.<init>(
...<many more times>...

7 years ago
How do I subscribe to all posts in a particular forum ?

I am preparing for Oracle certified Master Java developer. I wish to receive all new posts / replies in that forum

Please let me know it can be done.

7 years ago
Hi Ranch office,

Java Ranch Rule Round-up (Cow game) at

is giving security warning "Application Blocked by Java Security" because Java is considering QuizApplet as an untrusted application. I tried adding

to the Exception Site List and got a security warning "Including an HTTP Location on the Exception Site List is considered a security risk". I tried opening

and got Certificate Error "There is a problem with this website's security certificate"

Refer attached screen shots. It would be really helpful to a lot of Rancher's if this security problem is fixed.

8 years ago
Hi Moderators,

New Forum could be created to discuss coding style / coding standards preferably under Engineering

in which members can discuss

Java Programming Style Guide

Google Java Style

Java Programming Style Guidelines


8 years ago
I think the examiners want "You the architect" to decide which of these two is the better choice and be able to justify that choice in your design decisions. Discussing the pros and cons of these two designs could be considered a violation of the Oracle policy because then we would be discussing the actual solution.