Cant get it to recognise this methord

Please could you help me, i cannot get setMessage method to work, could you tell me why, and how i might resove this.
Thankyou
import java.io.*;
     class Message {
          String msg;
     // This methord lets you store messages
     // this methord lets you store messages in the object
     void setMessage(String m) {
     msg = m;
     // this methord prints out the message that is stored
     void printMessage() {
          System.out.println(msg);
class testmessage{
          public static void main(String args[]){
          Message mymessage1 = new Message();
          mymessage1.setMessage = "hello";

This works out fine
import java.io.*;
class Message {
String msg;
// This methord lets you store messages
// this methord lets you store messages in the object
void setMessage(String m) {
msg = m;
// this methord prints out the message that is stored
void printMessage() {
System.out.println(msg);
}And....
class testmessage{
public static void main(String args[]){
Message mymessage1 = new Message();
mymessage1.setMessage("hello");
mymessage1.printMessage();

Similar Messages

  • This concerns my apple tv. Cant get it to recognise my user id or password even though I've repeatedly verified it on my computer.

    This concerns my apple tv. Cant get it to recognise my user id or password even though I've repeatedly verified it on my computer.

    I was having the same problem. After reading a few threads, restore your Apple TV to its original factory settings (approximately 15-20 minutes) and try logging in again. It just worked perfect for me!

  • Cant get bootcamp to recognise thunderbolt to vga

    cant get bootcamp to recognise thunderbolt to vga

    This works out fine
    import java.io.*;
    class Message {
    String msg;
    // This methord lets you store messages
    // this methord lets you store messages in the object
    void setMessage(String m) {
    msg = m;
    // this methord prints out the message that is stored
    void printMessage() {
    System.out.println(msg);
    }And....
    class testmessage{
    public static void main(String args[]){
    Message mymessage1 = new Message();
    mymessage1.setMessage("hello");
    mymessage1.printMessage();

  • I have an itunes icon and the usb cable picture in my itouch and i cant get it off as this is frozen on my screen. Can anyone help with this    thank you

    I have a picture of the itunes icon and a usb cable on my screen and cant seem to get rid of it as it is frozen with this on. Can any one help please

    Connect the iPod to your computer and restore via iTunes
    iTunes: Restoring iOS software

  • HT1918 no matter wht i put in on the billing address is ses for assistance contact this web site so i cant get any app till this is fixed

    .

    If you are getting a message to contact iTunes Support then you can do so via this link and ask them for help (we are fellow users here on these forums, we won't know why you are getting the message) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • My apple tv is not working everytime i try to down load it stops and says error try again later i have updated credit card itunes and rebooted both and still wont work i am loosing my patience as i cant get any support for this

    my apple tv is not working every time i try to download a movie it says error try again later

    I am having this problem.  At first with the new iPhone 5, and then with the iPad 2.  I am not sure why this is happening. 
    My gut feeling is this is an iO6 issue and here's why -
    The problem mainly occurs with apps.  I have about 150 apps, and when I plugged in the phone, iTunes went to sync all of them.  The process would hang up after about 20 - 30 apps were loaded onto the phone. I could tell where about the process hung up because the apps on the phone showed up as "waiting".
    Then on the iPad 2 I plugged in to sync and saw there was a huge "Other" component in my storage.  It required me to restore the iPad 2 from backup.  With this restore the same issues occurred - putting the apps back on the iPad would hang up.  The videos on the iPad also got stuck - maybe after about 10 hours of videos transfered iTunes crashed.
    My solution has been to soft reset the device, restart Windows, and continue the process until it's complete.  This is remarkably inefficient and time-intensive but everything works with patience.
    I have been wondering if others have had these same problems. 

  • I still cant get my head around this:  java.lang.NullPointerException

    heres my disgusting amount of code and its error report. please help. its basically the board for a twixt game. if you dont know what that is its not important because the error has nothing to do with the rules of the game.
    Exception in thread "main" java.lang.NullPointerException
         at Board.pcomp(Board.java:81)
         at Board.addremovebridge(Board.java:34)
         at Twixt.main(Twixt.java:21)
    Thanks again for reading this far.
    public class Twixt {
         public static void main(String[] args) {
              Board game = new Board();
              point p = new point();
              p.x = 4;
              p.y = 4;
              p.p = 1;
              point f = new point();
              f.x = 5;
              f.y = 6;
              p.p = 1;
              String s = new String();
              s = game.placetower(p);
              s = game.placetower(p);
              System.out.println(s);
              s = game.placetower(f);
              System.out.println(s);
              s = game.addremovebridge(p,f);
              System.out.println(s);
              s = game.addremovebridge(p,f);
              System.out.println(s);
    public class point {
         int x = 0;
         int y = 0;
         int p = 0;
    import java.lang.Math;
    public class Board{
         public int[][] board1 = new int[26][26];
         public point[][][] board2 = new point[26][26][6];
         private int board3d;
         private int board3e;
         /*Board() {
              for(int x = 0; x<=25; x++){
                   for(int i = 0; i<=25; i++){
                        for(int j = 0; j<=6;j++){
                             pmakezero(board2[x][j]);
         public String placetower(point d){
              if (board1[d.x][d.y] == 0){
                   board1[d.x][d.y] = d.p;
                   return ("Tower placed at "+d.x+", "+d.y+".");
              }else{
                   return ("That space is already taken.");
         public String addremovebridge(point d, point e){
              if(checkplayer(d,e)){
                   boolean removebridge = false;
                   for(int i = 0; i<=5;i++){
                        if(pcomp(board2[d.x][d.y][i], e)){
                             pmakezero(board2[d.x][d.y][i]);
                             removebridge = true;
                        if(pcomp(board2[e.x][e.y][i], d)){
                             pmakezero(board2[e.x][e.y][i]);
                             removebridge = true;
                   if(distance(d,e)&&!intersect(d,e)&&!removebridge&&!full(d,e)){
                        board2[d.x][d.y][board3d] = e;
                        board2[e.x][e.y][board3e] = d;
                        return ("Bridge placed between "+d.x+", "+d.y+" and "+e.x+", "+e.y+".");
                   }else{
                        return ("That is not a valid bridge placement.");
              }else{
                   return ("That tower does not belong to you.");
         private boolean distance(point d, point e){
              double g;
              int f;
              int i;
              f = d.x - e.x;
              i = d.y - e.y;
              f = f*f;
              i = i*i;
              f = f+i;
              g = f;
              if (g>0){
                   g = g * -1;
              g = Math.sqrt(g);
              if(g == Math.sqrt(5)){
                   return true;
              }else{
                   return false;
         private boolean pcomp(point d, point e){
              if(d.x == e.x && d.y == e.y){
                   return true;
              }else{
                   return false;
         private void pmakezero(point d){
              d.x = 0;
              d.y = 0;
              d.p = 0;
         private boolean checkplayer(point d, point e){
              if(board1[d.x][d.y] == d.p && board1[e.x][e.y]==e.p){
                   return true;
              }else{
                   return false;
         private boolean full(point d, point e){
              point x;
              int y;
              int z;
              boolean full = true;
              for(int i=0; i<=5; i++){
                   x = board2[d.x][d.y][i];
                   y = x.x;
                   z = x.y;
                   if(y == 0 && z == 0){
                        board3d = i;
                        i = 3;
                        full = false;
              for(int i=0; i<=3; i++){
                   x = board2[e.x][e.y][i];
                   y = x.x;
                   z = x.y;
                   if(y == 0 && z == 0){
                        board3e = i;
                        i = 3;
                        full = false;
              return full;
         private boolean intersect(point d, point e){
              boolean inter = false;
              int f;
              int h;
              f = d.x - e.x;
              h = d.y - e.y;
              if(f == 2 && h == 1){
                   if(board1[e.x + 1][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 2][e.y + 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x][e.y + 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x - 1][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 2][d.y - 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x][d.y - 2][w]==d){
                                  inter = true;
                   }else if(board1[e.x + 2][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 1][e.y + 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x - 2][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 1][d.y - 2][w]==d){
                                  inter = true;
              }else if(f == -2 && h == -1){
                   if(board1[e.x - 1][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 2][e.y - 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x][e.y - 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x + 1][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 2][d.y + 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x][d.y + 2][w]==d){
                                  inter = true;
                   }else if(board1[e.x - 2][e.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 1][e.y - 2][w]==e){
                                  inter = true;
                   }else if(board1[d.x + 2][d.y]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 1][d.y + 2][w]==d){
                                  inter = true;
              }else if(f == 1 && h == 2){
                   if(board1[e.x][e.y + 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 2][e.y + 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x + 2][e.y][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y - 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 2][d.y - 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x - 2][d.y][w]==d){
                                  inter = true;
                   }else if(board1[e.x][e.y + 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x + 2][e.y + 1][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y - 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x - 2][d.y - 1][w]==d){
                                  inter = true;
              }else if(f == -1 && h == -2){
                   if(board1[e.x][e.y - 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 2][e.y - 2][w]==e){
                                  inter = true;
                             }else if(board2[e.x - 2][e.y][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y + 1]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 2][d.y + 2][w]==d){
                                  inter = true;
                             }else if(board2[d.x + 2][d.y][w]==d){
                                  inter = true;
                   }else if(board1[e.x][e.y - 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[e.x - 2][e.y - 1][w]==e){
                                  inter = true;
                   }else if(board1[d.x][d.y + 2]!=0){
                        for(int w=0;w<=5;w++){
                             if(board2[d.x + 2][d.y + 1][w]==d){
                                  inter = true;
              return inter;
    Thank you.

    Exception in thread "main"
    java.lang.NullPointerException
         at Board.pcomp(Board.java:81)
         at Board.addremovebridge(Board.java:34)
         at Twixt.main(Twixt.java:21)
    So the null pointer occurs on the 81st line in the Board.java source code file. I'm not sure, but I expect this is line 81.if(d.x == e.x && d.y == e.y){Here's one way to troubleshoot null pointer problems. First find the line causing the error. Then, use System.out.println() statements to display the values of all the reference variables in that line, one variable at a time. So if I guessed correctly on line 81, you would put these statements just before line 81System.out.println("d " + d);
    System.out.println("e " + e);Because d and e are the only reference variables in that line. When you run the code after putting these lines in, one or both of these will display "null" and that will tell you which variable to trace. You will need to trace backward through your code a find out why d or e or both are null.
    (hint: A statement like Object[] objects = new Object[10];" creates an Object array with 10 elements, each of which is null. You have to use "objects[1] = new Object();" to create an element in the array which is an Object.)

  • HT1349 hi guys i have 2 ? 1 my daughters iphone is trying to update on my mac cant get it off help please ,,, 2 i have an old apple id and when i try to up date it keeps looking for the password how do i delete this old apple id help

    hi guys i have 2 ? 1 my daughters iphone is trying to update on my mac cant get it off help please ,,, 2 i have an old apple id and when i try to up date it keeps looking for the password how do i delete this old apple id help

    Hi.
    I had a similar problem myself. This is what helped me.
    I went to the App store app, scrolled to the bottom, logged out of the account, re logged in with my Apple ID.  Then went back to app updates. Once I put in my ID password all was fine.

  • Hi, I have a late 2011 MacBook Pro but cant get the mirroring function to work with Apple TV.  I've got the most recent Software 10.7.5 but cant see the mirroring icon or turn this on.  I'm able to mirror from my Ipad but not my Mac, any thoughts?

    Hi, I have a late 2011 MacBook Pro but cant get the mirroring function to work with Apple TV.  I've got the most recent Software 10.7.5 but cant see the mirroring icon or turn this on.  I'm able to mirror from my Ipad but not my Mac, any thoughts?

    Welcome to the Apple Support Communities
    AirPlay Mirroring is supported on your Mac, but it needs OS X Mountain Lion (10.8). See > http://support.apple.com/kb/HT5404
    You have two possibilities:
    1. Make a backup, open App Store and purchase Mountain Lion to upgrade to this OS X. Then, you will find the AirPlay Mirroring icon at the top right of the display, on the menu bar, or on System Preferences > Displays.
    2. Keep OS X Lion and use AirParrot > http://www.airparrot.com
    Both options work properly, but I recommend AirPlay Mirroring as it doesn't need a third-party program

  • HT5312 When I got my Ipod Touch 3 years ago, my mum set up an Apple ID in her name & email address. I have since got an Ipad & set up my own Apple ID. How can I update my Ipod to my Apple ID? I would like to sync the Ipad and Ipod, but cant get past this

    When I got my Ipod Touch 3 years ago, my mum set up an Apple ID in her name & email address. I have since got an Ipad & set up my own Apple ID. How can I update my Ipod to my Apple ID? I would like to sync the Ipad and Ipod, but cant get past this ID problem?

    Hi AnnieAnneok,
    Welcome to the Support Communities!
    The articles below may be able to help you with this.
    Click on the links to see more details and screenshots. 
    First, I would suggest you backup your iPod touch and transfer purchases to your computer:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    Confirm your Apple ID is set up and updated with the correct information:
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Then, in Settings on your iPod touch, sign out of your iCloud Account and your iTunes Store account and sign back in with the correct Apple ID.
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Cheers,
    Judy

  • Help, i really need my phone for security this weekend and now i cant get it to do anything :(

    Hi, i went to sync and back up my iphone 3GS as i ahve done many times before, it encountered an OS problem and put the phone into a restore mode. Now i havnt had this happen before, it has the USB cord with itunes logo on screen, cant get the phone to do anything else. When i plug it in it says i have to restore.. But will i then as i suspect loose my 600 new work photos, data, games progress, work notes, new contacts etc as i suspect i will? please someone tell me no and there is something i can do to avoid this.

    The data is already gone. You have no choice but to restore.

  • I've upgraded to Mavericks. HP Scan no longer works to scan images from an HP Photosmart c309a yet the printer works. My Mac does not recognise this scanner as a scanner, only as a printer. How do I get my applications such as Preview to use this scanner?

    I've upgraded to Mavericks. Formerly HP Scan we used to establish communications with an HP Photosmart c309a all-in-one printer/scanner on my wi-fi network. As of the Dec 2013 update to Mevericks, it appears that HP Scan is now disabled and I cannot find this device as a scanner in System Preferences. I cannot connect to it in either Preview, Pages, or Photoshop Elements 8. Does anyone know a way of getting the OS to recognise this as a scanner?

    How was the printer added? Using AirPrint or the HP ppd? Since Mavericks defaults to adding an AirPrint printer with the AirPrint ppd, it might be necessary to add it again with the HP ppd, after making sure you have the HP drivers installed.

  • I have just upgraded to an Iphone 5 and cant get my contacts to sync. My 4s Contacts default account was from my Mac - but I dont seem to ahve this option on my 5? How do I sync them?

    I have just upgraded to an Iphone 5 and cant get my contacts to sync. My 4s Contacts default account was from my Mac - but I dont seem to ahve this option on my 5? How do I sync them?

    The way I do it is I hook to my windows computer, it will pop up iTunes. I click iTunes off. The phone will show as another drive on your computer. Click it open then migrate to the photos folder from the iPhone.
    Then select all, cut then right click on your pictures folder on your computer or make a new folder on your desk top like I do and right click on new folder and select paste.
    Photos will be gone. Just remember to turn off the iPhone sync in your photos folder on the phone or they will come back
    Good Luck

  • HT1222 ok i cant get itunes to open it installs and when i click on the icon it takes me to the agreement dicloser i click agree and thats it it closes this happens everytime. ive installled and uninstalled it a number of times and still nothing??

    i cant get i cant get itunes to open! Help!!!

    Refer to this article to remove SC files:
    http://support.apple.com/kb/TS2363
    Then proceed to repair your QuickTime.
    START > CONTROL PANEL > PROGRAMS N FEATURES > highlight QUICKTIME and click CHANGE then REPAIR.

  • Had update issues but now my iphone is in a loop of the apple sign then the circling thing, itunes doesnt even pick it up, cant get past this point!! ? any help?

    had update issues but now my iphone is in a loop of the apple sign then the circling thing, itunes doesnt even pick it up, cant get past this point!! ? any help?

    You might want to check this thread https://discussions.apple.com/thread/3374367 hope this helps

Maybe you are looking for

  • Need help in using a API

    I am new to flash . And my doubt may seem very trivial. I hae a problem using the Flash administation API "getLiveStreams()" . I am supposed to get the list of all live streams. However in the client when i do nc.call("getLivestreams",responder); i d

  • Macbook Pro to Asus monitor best connection?

    I have a late 2013 mbp and just bought an Asus VS248H-P monitor to hook up to it. I've heard of different ways to connect them, for example, HDMI to HDMI, HDMI to thunderbolt, and DVI to thunderbolt. I was wondering which would look the best on the m

  • Computer will not get past the windows screen

    i have recently had an issue where my touchsmart 310 pc wont load past the window screen and if i try and get past with a system repair disk, it loads the disk and then goes to some underwater type screen and sits there and does nothing else( i left

  • Phone is stuck in black and white + lost data

    help! I tried to transfer the addressbook from my old blackberry pearl to my new one and instead it just deleted practically everything. the screen is all black and white and I can't do anything....I'm pretty sure all my data is lost. My phone is out

  • Why do I have 2 conversations to the same person on my ipad?

    This is absoultey rediculious! Please help. Both users have Iphones and Ipads.  (most current updates) User 1 Iphone 4 and Ipad 3G User 2 Iphone 4 and ipad (WIFI only) Have a current imessage conversation going from iphone to iphone. the conversation