Hello,

I'm new to Java and have been using NetBeans 6.5 as my IDE. I have been learning how to create classes and have come to the point where I must compile two files simultaneously. I fail to understand why I must compile them at the same time and how to accomplish this using NetBeans. The book I'm using is based on Java SE 6 and they use the javac command in their example. I also fail to understand why only one of the two files contains the main method. I assume that file will call the method from the file that doesn't contain the main method.

The simplest example I can I think of is calculating the circumference of a circle. The "calling" program, the one containing the main method, would prompt the user for the radius. The "called" program, the one not containing the main method, would calculate the circumference. Am I on the right track?

Regards,

Mark

Views: 14

Reply to This

Happy 10th year, JCertif!

Notes

Welcome to Codetown!

Codetown is a social network. It's got blogs, forums, groups, personal pages and more! You might think of Codetown as a funky camper van with lots of compartments for your stuff and a great multimedia system, too! Best of all, Codetown has room for all of your friends.

When you create a profile for yourself you get a personal page automatically. That's where you can be creative and do your own thing. People who want to get to know you will click on your name or picture and…
Continue

Created by Michael Levin Dec 18, 2008 at 6:56pm. Last updated by Michael Levin May 4, 2018.

Looking for Jobs or Staff?

Check out the Codetown Jobs group.

 

Enjoy the site? Support Codetown with your donation.



InfoQ Reading List

Figma's $300,000 Daily AWS Bill Highlights Cloud Dependency Risks

Figma's IPO filing reveals a staggering $300,000 daily spend on AWS, totaling $100 million annually, or 12% of its $821 million revenue. The company's deep reliance on AWS exposes it to significant risks, including potential outages and policy changes. This highlights the critical dilemma for tech firms: balancing the benefits of cloud agility with rising costs and vendor lock-in challenges.

By Steef-Jan Wiggers

Presentation: Inflection Points in Engineering Productivity as Amazon Grew 30x

Carlos Arguelles discusses pivotal inflection points throughout Amazon's monumental growth. He explains how significant operational crises, exponential engineer growth, and market shifts drove crucial investments in engineering productivity and foundational infrastructure, offering valuable lessons for senior developers and leaders.

By Carlos Arguelles

Article: Ceph RBD Turns 15: A Story of Open Source Creation

Fifteen years ago, Ceph RBD began as a community-driven idea that grew into essential infrastructure powering today's cloud platforms. This insider story from Yehuda Sadeh-Weinraub reveals how two developers started a distributed storage that now supports OpenStack and Kubernetes through transparent, collaborative development.

By Yehuda Sadeh-Weinraub

Podcast: Mandy Gu on Generative AI (GenAI) Implementation, User Profiles and Adoption of LLMs

In this podcast, Mandy Gu from Wealthsimple discusses how to establish AI programs in organizations and implement Generative AI (GenAI) initiatives, and the relationship between user profiles and adoption of LLMs.

By Mandy Gu

Azure AI Foundry Agent Service Gains Model Context Protocol Support in Preview

Microsoft's Azure AI Foundry Service now supports the Model Context Protocol (MCP), revolutionizing AI agent integration. This streamlined approach eliminates cumbersome custom coding, allowing seamless connection to data sources and workflows. With enterprise-grade security, developers can effortlessly enhance agent capabilities, ushering in a new era of interoperability and efficiency in AI.

By Steef-Jan Wiggers

© 2025   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service