Help... dont know what's the problem.. accessing another class
(im new to java =c)
well i have a file named accessfiles.java as my main page and i have another java file named try1.java
i can access try1.java from accessfiles.java using a simple case..... but how come i cant return to accessfiles.java?
is it with the string[]args?? do i have to erase it?
please help me =c
accessfiles.java
import java.io.*;
public class accessfiles{
public static void main(String[]args)throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("\nMAIN MENU");
System.out.println("[1] for Prelim MP1");
System.out.print("CHOICE: ");
switch(c)
case 1:
try m1=new try1();
m1.try();
break;
default: System.out.println("Invalid Input!");
break;
try1.java
import java.io.*;
public class try1 {
public static void try()throws Exception
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int x=0;
int y=0;
int r=0;
System.out.println("1st Pattern");
for (x=1;x<=5;x++)
System.out.println(" ");
r=x;
for (y=1;y<=r;y++)
System.out.print(y);
System.out.println(" ");
System.out.println(" ");
System.out.println("2nd Pattern");
for (x=5;x>=1;x--)
System.out.println(" ");
r=x;
for (y=1;y<=r;y++)
System.out.print(y);
accessfiles m2=new accessfiles();
m2.main();
break;
}
For starters, you don't seem to understand the difference between a static and non-static method. Here is an example of how to call a method in a different class.
public class MainClass {
public static void main(String[] args) {
MainClass app = new MainClass();
app.go();
public void go() {
System.out.println("start of go");
another.method();
System.out.println("end of go");
private AnotherClass another = new AnotherClass();
public class AnotherClass {
public void method() {
System.out.println("method");
}
Similar Messages
-
HT201303 I dont know what is the problem to bye some thing frome some games
I dont know what is the problem to bye some thing frome some games
I don't know either, more information would be helpful.
-
i download a file in the torrent site which is MP4 but unfortunately i tried to delete it but i can not. but all the files that i have is easily to delete only MP4 files i can't delete in the download foldeer please try to help dont know what to do please
Well you can sync your iPod/iPhone to yur computer or laptop then take the photos off of your iPod like taking photos of of a SD card (from a normal camera) or off of a USB..! Good Luck. plz tick this saying This solved my question if it helps you.
-
I bought iphone 3gs in singapore last year,I had no problem to use it in Singapore & Malaysia but after i upgrade to ios5,i can't use it in malaysia.It will automatic restart my phone itself. Is it because of IOS5 problem?!Because when I register my itune a/c, I selected the country is Singapore. Anyone know what is the problem & how can I solve it?!
If it automatically restarts the phone firmware is corrupt. Restore the phone with iTunes and set up as a new phone, do not restore your backup, which is likely where the corruption is. If it then works you can try restoring just the backup. If that breaks it again you know where the problem is; you will have to start over and manually reinstall your content.
To restore just the backup, right click on the phone's name in iTunes and select "restore from backup" -
please i did pay to renew my ios developer account and you sent me an email to reply within 2 business days, but nothing happend yet. may i know what is the problem?
This is primarily a user-to-user support forum and not related to developers. The following link has information about checking your program enrollment: https://developer.apple.com/support/ios/enrollment.html#howcanicheckstatus
If that doesn't help, there is a "Contact Us" button at the bottom of the page in the above link. -
Hello, i am using ipad mini now. When i charge it till 90%, it will stop charging on its own. I need to reconnect in order to charge it till 100%. Another problem is when i am using an apps, for example looking through the photo, suddenly the screen will back to Home. Anyone know what is the problem? Thanks.
This is a user-supported board. You are not addressing Apple here. Nor is it a good idea to post your private information to a public forum. You should edit your post immediately.
Unfortunately no one here can access your support history. You must respond to the emails directly. -
I have a big problem in my phone charger . I have Iphone 5s . I don't know what is the problem but the bettery is not working true . A decrease in the battery very quickly and then turns off the machine . Please, I want to address this problem quickly .
http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/
-
my iphone 4 i already up date new software ios 7. but now i can not open my phone.. please let me know what is the problem ?
sir, i dawonlodding the new software ios 7,that time my phone henged then now i can`t open it.pls let me know whats problem?
-
Hello guy, i have a problem when playing the FL commando which when i am playing the game , sudden the game is log out by itself. I would like to know what is the problem for my ipod 4g, just buy recently only and having ios 5.0.1
- See:
iPod touch: Hardware troubleshooting
- Try another cable. Some 5G iPods were shipped with Lightning cable that were either initially defective or failed after short use.
- Try another charging source
- Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
- Make an appointment at the Genius Bar of an Apple store.
Apple Retail Store - Genius Bar -
HELLO
I was playing candy crush and I had too much problem with my bill your charge too much I want to know what is the problem with this game costTake it up with iTunes Support - we are not Apple here, we are just users like you:
http://www.apple.com/support/itunes/ww/
Cheers,
GB -
hi one of the main important questions which this site didnt answer to it is: whats the latest version of ios which any device work with it. for example i have a ipad 1st and i dont know whats is the latest version of ios for this device
Google "iOS versions" and read the first match (Wikipedia)........
-
HELP dont know what to do!!
Hi, Just wondering if anyone can help! I really dont know what to do! I am trying to restore my ipod and it says when i click retore 'firm wire disk write error' i really dont know what do about that just wondering if anyone knows here?? Thanks
The thing is, that you must try the suggestions in that article. There are other things that you can try in this post also.
http://discussions.apple.com/message.jspa?messageID=1533747#1533747
They're not easy to follow if you're not computer savvy. Do you have someone at home who can assist and take you through the steps?
There is also a simple thing you can try such as trying another port on your computer. Some ports are not connected direct to the motherboard and do not recognize the iPod as well as those that are. Reset the iPod each time you connect it to another port.
The error means that the computer is having a hard time writing data to the iPod's hard drive, and there could be many reasons for this.
How about taking the iPod to an Apple store? Isn't there one at the Trafford centre? -
Help Dont know what this code is doing ?????
i dont know what this code is doing from the for part can some one explain it for me
i am confused starting at the for statement thanks for the help
public class LeastToGreatestPlaceHolder {
public static void main(String []args) {
int [] myArray;
myArray = new int[3];
myArray[0] = 6;
myArray[1] = 7;
myArray[2] = 9;
for (int i = 0; i < 2 ; i++){ // confused here
for(int j = 1; j < 3; j++) {
int placeholder = myArray[j];
if (myArray[i] > myArray[j]) {
myArray[j] = myArray;
myArray[i] = placeholder;
System.out.print(myArray[0]);
System.out.print(myArray[1]);
System.out.print(myArray[2]);Have you tried running the program and seeing what it outputs?
Have you considered writing out the state of the array and running through the code by hand?
I'll give you a [head start|http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.html]. -
I don't know what is the problem..
I have a CISCO6506-E, with Sup II with PFC and an 8-Port GBIC connected to a 4506 on GBIC.
I have tagged the vlan, configure the trunk but I cannot ping the 4506 from the 6506. The 6506-E is just a forwarding switch (L2). What coud be the problem. I have check the status, no vlan mismatch, trunk is good, CDP is good.Hi H,
I do not think there is an command like "set trunk negotiate disable" I think you might have given command "set trunk nonegotiate" and it should not create any problem as it just bring the trunk up without sending any DTP packet.
You cannot put negotiate on both sides and that is the probable reason trunk is going down. Negotiate keyword is just to let the switch know what is the encapsulation cofnigured on other side i.e isl or dot1q and it will work accordingly.
Can you please explain what have you configured as trunk mode on other side? I think we are lacking in some config if you just post the related config it will be of help.
Regards,
Ankur -
Download using wifi is very slow for my ipad may i know what is the problem?
Downloading using wifi is very slow for my ipad may i know what is the problem
Maybe your internet speed is slow. Check your download speed.
https://itunes.apple.com/sg/app/speedtest.net-mobile-speed/id300704847?mt=8
Maybe you are looking for
-
Setting CC field in Sender Mail Adapter
Hi, I am on SP16, and using Sender Mail Adapter. I need to retrieve the CC field from the mail. I have set the <i>Adapter-Specific Message Attributes</i>. ie. Set <i>Adapter-Specific Message Attributes</i>, and <i>Variable Transport Binding</i> boxes
-
The entire display on my iMAC has gone into some kind of "negaive" (in the photo-sense. Any clues on how to get it back to normal?
-
Problem when installing jwsdp 1.5 in suse 9.2
Greetings!! I am trying to install the jwsdp 1.5 in suse 9.2 and when I execute the installation script it throws me an exception: "Exception in thread "main" java.lang.NoClassDefFoundError: JWSDP" and for but that have attempted I have not been able
-
Cant access IPS 4240 on the newtork
Hello Folks, Below is my configurations for a new IPS we jsut bought .my problem is I can not access it on the network via Cisco IDM launcher. I have connected it via a trunk port to the distribution Switch on the network and trying to from an ip add
-
Poor Result using Panasonic Frame Rate Converter. Please Help!
Hey All, Myself and a crew of other university filmmakers shot some footage at 720P and 60 FPS on the Panasonic HVX-100 with the hopes of converting it to 24fps for smooth slow motion. We are using FCP 5.1.2 and the panasonic DVCPROHD Frame Rate Conv