Set inclusion in Java

Can anyone show me how to write a contains method to show set inclusion. I have two HashSets s1 and s2 with elements in them I have an iterator to show the elements in each set. The next stage is to write a method that will show that s2 is included in s1. I have been told to use a contains method, any help to get me started would be very much appreciated. This is what I have so far.
import java.util.HashSet;
import java.util.Iterator;
import java.util.TreeSet;
public class Specification {
     public static void main(String[] args) {
     // Create two sets.
     HashSet s1 = new HashSet();
     s1.add("r1");
     s1.add("r2");
     s1.add("r3");
     HashSet s2 = new HashSet();
     s2.add("r1");
     s2.add("r2");
     //use iterator to retrieve elements from set S1
     Iterator it = s1.iterator();
     while(it.hasNext())
     System.out.println(it.next());

muj wrote:
I wanted to know how to write a contains method to show that S1 contains S2. I was hpoing somebody could help me get started on this, as in what code is required to write a contains method.For general questions like this (especially ones that appear to be homework), the best we can do is direct you to the basic tutorials.
However, if you show us where you're stuck, what you've been trying, a specific question on a specific part of Java, then we'd be happy to help.
Read also: [So, You Need to Write a Program but Don't Know How to Start|http://home.earthlink.net/~patricia_shanahan/beginner.html]
[How To Ask Questions The Smart Way|http://catb.org/esr/faqs/smart-questions.html]

Similar Messages

  • Setting Up a Java Web Server on Linux

    Greetings,
    After a lot of reading, I've decided to learn Java server-side technologies (I already know Java (desktop)
    but with little experience) in order to develop my database driven dynamic website projects.
    However, I'm completed lost between the hundreds of acronyms related to Java and the "thousands" of technologies involved.
    Google hadn't help me understand what they really are and how they relate with each other.
    Even though is easy to find what they stand for and some faqs/descriptions, it hasn't been enought to clear my mind.
    I want my webserver application to do, among other things, the following:
    Retrieve Data from a database, do generate dynamic html files.
    Story Data on the database, from html forms.
    Send automaticly emails for multiple users. (newsletter for example)
    E-Commerce.
    Html graber/parser (I don't know if this is the right word, I mean a program that for example, goes to a URL with an html
    table, and stores that information in a database table, as long as the format didn't change).
    Real Time Chat feature.
    Database connection pooling, caching, and other important optimizations.
    I'm not asking for how to develop or configure this features nor what components and programs, must be installed.
    At the moment, I only want to know how to set up a Java solution that will support them when they are needed.
    *** Linux ***
    I want to set up my webserver on a linux distribution.
    In that respect, I don't know if I should choose RedHat or Fedora Core.
    I've heard that fedora is better for a webserver (having in mind that Red Hat Enterprise AS/ES aren't free).
    But I've read in several sun turorials/webpages references to RedHat (on a J2EE context).
    So I'm wondering if is better to go for Fedora or RedHat. Are there pros & cons? They equally support Java?
    *** Technologies ***
    Then in starts the acronyms problem.
    What do I need to install, in what order, for what?
    Some aconyms and technologies, I have read about but don't fully understand are the following:
    Apache
    J2EE
    J2EE 1.4 SDK
    SUN Java System Application Server Platform Edition 8
    J2SE 1.4.2 SDK
    SUN Java Enterprise System
    Tomcat
    Struts
    Cocoon
    JBoss
    I already know J2EE is only a specification. What implements that specification? Sun Java System Application Server?
    J2SE SDK? or Tomcat?
    What is the role of each technology, namely Apache, Tomcat, Sun Application Server?
    What is the Sun Java Enterprise System?
    How do Struts, Cocoon, JBoss relate to Java?
    Which of these technologies are mutually exclusive (analogous)?
    *** Doubts ***
    Then, I have some doubts that are keeping me from starting to study seriously the important techonologies, because I don't
    want to lose lot's of time and effort learning them to after a dillusion start everything again with PHP (the language
    which make me think and read a lot before going for Java). To keep this from happening, I would like to know the following:
    I want to use Java for developing websites with commercial/profitable use for my company, in some throught e-commerce,
    and in other by banners. I want to do everything by the book, with required licenses.
    ------ Java is Free?
    Is Java Completely Free or it might be possible that at a certain point, when I need some component or library,
    multi-machine webserver, performance or security for high-traffic I will see "buy now" instead of "download now"?
    For what they may "ask for money"? and what are the disavantages if I can't buy?
    For example, "Java System Application Server Standard Edition 8.1 2005Q1" and
    "Java System Application Server Enterprise Edition 8.1 2005Q1" cost $2.000 and $10.000 respectively. That is money.
    (http://www.sun.com/software/products/appsrvr/index.xml). What are the disavantages if stick to the free edition?
    Features like (from sun site)
    Standard Edition:
    Extends the capabilities of the Platform Edition to provide secure, remote, multi-instance, multi-machine management.
    It is aimed at high-volume applications and Web services.
    Enterprise Edition:
    Further extends the capabilities of the Standard Edition to provide continuous availablity for applications and
    Web services. It is aimed at business critical, high value applications and Web services.
    Suppose I achive lots of traffic and I keep the free platform edition.
    I won't be able to have a multi-machine webserver set up correctly?
    What are the drawbacks? How big are the performance penalties?
    ------ Technologies Availability
    Finnaly, I have the idea (I don't know if it's accurate) that there are Sun versions and Open-Source Free versions
    of doing or supporting the same Java related thing.
    Despite the way I choose to set up a Java webserver, I will always have all J2EE techonolies like:
    Java API for XML-Based RPC (JAX-RPC), JavaServer Pages, Java Servlets, Enterprise JavaBeans components,
    J2EE Connector Architecture, J2EE Management Model, J2EE Deployment API, Java Management Extensions (JMX),
    J2EE Authorization Contract for Containers, Java API for XML Registries (JAXR), Java Message Service (JMS),
    Java Naming and Directory Interface (JNDI), Java Transaction API (JTA), CORBA, and JDBC data access API.
    I really appreciate some help. I could learn the basics of all this "stuff" before asking. But the point why I'm asking
    is precisely not starting to learn something I may won't use. Obviously, I will have to make a lot of reading during maybe
    months before writing the first line of code of my projects, but being certain that it will fit my needs.
    I will be very thankful if you can enlightme in my fedora/redhat, setup, free/cost and technologies avaibility issues.
    Thanks Beforehand,
    Pedro Vaz

    Apache is a free Web-server.
    Tomcat is a servlet (and JSP) container. It can be stand-alone or can be used together with a Web server (like Apache).
    J2EE's scope is much wider than the servlet stuff, but a standalone Tomcat is a good starting point to servlets and JSP.
    One of our "real-world" applications is run by a standalone Tomcat using POI and Velocity. I did not regret this architectural decision.

  • How to set up a Java Plug-in Download page in case of netscape?

    hai all of you,
    i have a problem regarding downloading plugin.
    i am using <object > and <embed> tags to download the plugins inorder to run the applets. but it is taking long time to download the plugin form sun.com.
    so what i have done is, i downloaded the plugin.exe file and .cab file and put it in my tomcat server mainted by other party.(y application if for internet purpose only.)
    i refered to http://java.sun.com/products/plugin/1.2/docs/intranet.html. there it is mentioned that, to download the plugin.
    for I.E i can able to change the code.
    but for NetScape it's a little bit confusing.
    i have downloaded the binary file in my own directory.
    here he is asking to set up a java plugin-in download page.
    instead of this "plugin-install.html" page what page i should create and what should be the code in this page if i have to write on my own. please let me know if anybody know about it.
    following para is from sun.com
    "To deploy Java Plug-in in intranet environments with Navigator, you need to download and store the Java Plug-in binary file on one of your web servers. Then you need to set up a Java Plug-in Download page and modify the pluginspage attribute in the EMBED tag to refer to this page. The Download page should have options to download different versions of Java Plug-in, such as for Windows and Solaris. For example, if you have set up the Java Plug-in Download page at "http://javaweb.eng/plugin/" and the page is called plugin-install.html, you can specify the pluginspage as "http://javaweb.eng/plugin/plugin-install.html". "
    thanks
    by
    sambareddy

    I have successfuly done this.
    Change the converted html as per the instructions to point to another page.
    Here is an example of the new html page you need to create:
    <html>
    <head>
    <title>Java Plugin Install Page</title>
    </head>
    <body>
    <h2><center>Java Plugin Install Page</center></h2>
    <p></p>
    <h3>Windows Version Only!!!</h3>
    Click here to Download Plugin
    <p></p>
    <p>You may or may not be asked to either save or run from current location</p>
    <p>If the run from current location is available, use that option</p>
    <p>If you can only save the file, then save it to your workstation and exit the download page and exit Netscape. Then using Windows Explorer, go to where you downloaded the file and double click on the file to run it. Accept all options during the install process and once it has finished try accessing your web page again using Netscape. You should then get to the web page or application and this page will not apppear again.
    </body>
    </html>
    If you put the file j2re-1_3_1-win.exe on a web server somewhere then you will have to prefix the file with
    http://yourwebserverdirectory/
    Hope this helps.

  • How to change a setting in the Java Control Panel with command line

    Hi,
    I am trying to figure out how to change a setting in the Java Control Panel with command line or with a script. I want to enable "Use SSL 2.0 compatible ClientHello format"
    I can't seem to find any documentation on how to change settings in the Java Control Panel via the command line
    Edited by: 897133 on Nov 14, 2011 7:15 AM

    OK figured it out. This is for the next person seeking the same solution.
    When you click on the Java Control Panel (found in the Control panel) in any version of Windows, it first looks for a System Wide Java Configuration (found here: C:\Windows\Sun\Java\Deployment). At this point you must be wondering why you don't have this folder (C:\Windows\Sun\Java\Deployment) or why its empty. Well, for an enterprise environment, you have to create it and place something in it - it doesn't exist by default. So you'll need a script (I used Autoit) to create the directory structure and place the the two files into it. The two files are "deployment.properties" and "deployment.config".
    Example: When you click on the Java Control Panel it first checks to see if this directory exists (C:\Windows\Sun\Java\Deployment) and then checks if there is a "deployment.config". If there is one it opens it and reads it. If it doesn't exist, Java creates user settings found here C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7.
    __deployment.config__
    It should look like this inside:
    *#deployment.config*
    *#Mon Nov 14 13:06:38 AST 2011*
    *# The First line below specifies if this config is mandatory which is simple enough*
    *# The second line just tells Java where to the properties of your Java Configuration*
    *# NOTE: These java settings will be applied to each user file and will overwrite existing ones*
    deployment.system.config.mandatory=True
    deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties
    If you look in C:\Users\USERNAME\AppData\LocalLow\Sun\Java\Deployment on Windows 7 for example you will find "deployment.properties". You can use this as your default example and add your settings to it.
    How?
    Easy. If you want to add *"Use SSL 2.0 compatible ClientHello format"*
    Add this line:
    deployment.security.SSLv2Hello=true
    Maybe you want to disable Java update (which is a big problem for enterprises)
    Add these lines:
    deployment.javaws.autodownload=NEVER
    deployment.javaws.autodownload.locked=
    Below is a basic AutoIt script you could use (It compiles the files into the executable. When you compile the script the two Java files must be in the directory you specify in the FileInstall line, which can be anything you choose. It will also create your directory structure):
    #NoTrayIcon
    #RequireAdmin
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_UseX64=n
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    Func _JavaConfig()
         $ConfigFile_1 = @TempDir & "\deployment.properties"
         $ConfigFile_2 = @TempDir & "\deployment.config"
         FileInstall ("D:\My Documents\Autoit\Java config\deployment.properties", $ConfigFile_1)
    FileInstall ("D:\My Documents\Autoit\Java config\deployment.config", $ConfigFile_2)
         FileCopy($ConfigFile_1, @WindowsDir & "\Sun\Java\Deployment\", 9)
         FileCopy($ConfigFile_2, @WindowsDir & "\Sun\Java\Deployment\", 9)
         Sleep(10000)
         FileDelete(@TempDir & "\deployment.properties")
         FileDelete(@TempDir & "\deployment.config")
    EndFunc
    _JavaConfig()
    Now if you have SCUP and have setup Self Cert for your organization, you just need to create a SCUP update for JRE.
    Edited by: 897133 on Nov 16, 2011 4:53 AM

  • How do I set up a Java Server

    Hi there,
    I'm just got an assignment that need to set up a Java Server. I don't know how to start? May anyone help me?

    Maybe you should ask the person who gave you this assignment what the hell is a Java server?

  • Helo to set locale in java

    Dear All,
    please help me how to set locale in java and how it works.
    please send me the link or code.
    thanks in advance
    Anjul Tyagi
    Message was edited by:
    Anjul
    Message was edited by:
    Anjul

    GraphicsEnvironment.getAllFonts
    an array of available Fonts
    Add a new Font with new Font() contructor.
    Font f = new Font("Lucida Sans", font.PLAIN, 12)
    Method Font.createFont(int, InputStream) provides
    the ability to add fonts at runtime.

  • Setting java_home through java code

    Hello , i went through lots of information for setting java_home through java code but i was unable to find any useful information, does anybody know how to set java home through java code
    Regards
    Mayur Mitkari

    The question doesn't make any sense to me. If Java needs the JAVA_HOME variable set, how is it ever going to execute any code that does so? And if it doesn't need it, why set it?

  • What value should set for wrapper.java.initmemory?

    Hi guys,
    If this is the wrong forum to ask, I hereby apologize as I am not sure which forum should I deposit this question.
    I am using jboss4.0.5 installing in Cent OS with memory of 1024MB and jdk 1.5.0_08. Hence, what value should I set for wrapper.java.initmemory and wrapper.java.maxmemory? What actually is the wrapper.java for compare to JAVA_OPTS? my current configuration is like below:
    # Wrapper Properties
    # Java Application
    set.JAVA_HOME=/usr/java/j2sdk
    wrapper.java.command=%JAVA_HOME%/bin/java
    set.JBOSS_CONFIG=default
    set.JBOSS_HOME=/opt/jboss4
    set.JBOSS_LOG=/var/log/jboss4/%JBOSS_CONFIG%
    # Use new ticker
    wrapper.use_system_time=FALSE
    # Java Main class
    wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
    # Java Classpath (include wrapper.jar) Add class path elements as
    # needed starting from 1
    wrapper.java.classpath.1=%JBOSS_HOME%/lib/wrapper.jar
    wrapper.java.classpath.2=%JBOSS_HOME%/bin/run.jar
    wrapper.java.classpath.3=%JAVA_HOME%/lib/tools.jar
    # Java Library Path (location of Wrapper.DLL or libwrapper.so)
    wrapper.java.library.path.1=%JBOSS_HOME%/lib
    # Java Additional Parameters
    wrapper.java.additional.1=-Dprogram.name=run.sh
    wrapper.java.additional.2=-Djava.endorsed.dirs=%JBOSS_HOME%/lib/endorsed
    # Initial Java Heap Size (in MB)
    wrapper.java.initmemory=64
    # Maximum Java Heap Size (in MB)
    wrapper.java.maxmemory=128
    # Application parameters. Add parameters as needed starting from 1
    wrapper.app.parameter.1=org.jboss.Main
    wrapper.app.parameter.2=-c
    wrapper.app.parameter.3=%JBOSS_CONFIG%
    # Port which the native wrapper code will attempt to connect to
    wrapper.port=1777
    wrapper.startup.timeout=300
    wrapper.ping.timeout=300
    wrapper.shutdown.timeout=300
    wrapper.disable_shutdown_hook=TRUE
    wrapper.request_thread_dump_on_failed_jvm_exit=TRUE
    # Wrapper Logging Properties
    # Format of output for the console. (See docs for formats)
    wrapper.console.format=PM
    # Log Level for console output. (See docs for log levels)
    wrapper.console.loglevel=INFO
    # Log file to use for wrapper output logging.
    wrapper.logfile=%JBOSS_LOG%/server.log
    # Format of output for the log file. (See docs for formats)
    wrapper.logfile.format=LPTM
    # Log Level for log file output. (See docs for log levels)
    wrapper.logfile.loglevel=NONE
    # Maximum size that the log file will be allowed to grow to before
    # the log is rolled. Size is specified in bytes. The default value
    # of 0, disables log rolling. May abbreviate with the 'k' (kb) or
    # 'm' (mb) suffix. For example: 10m = 10 megabytes.
    wrapper.logfile.maxsize=0
    # Maximum number of rolled log files which will be allowed before old
    # files are deleted. The default value of 0 implies no limit.
    wrapper.logfile.maxfiles=0
    # Log Level for sys/event log output. (See docs for log levels)
    wrapper.syslog.loglevel=NONE
    # Wrapper NT Service Properties
    # WARNING - Do not modify any of these properties when an application
    # using this configuration file has been installed as a service.
    # Please uninstall the service before modifying this section. The
    # service can then be reinstalled.
    # Name of the service
    [email protected]@
    # Display name of the service
    [email protected]@
    # Description of the service
    [email protected]@
    # Service dependencies. Add dependencies as needed starting from 1
    wrapper.ntservice.dependency.1=
    # Mode in which the service is installed. AUTO_START or DEMAND_START
    wrapper.ntservice.starttype=AUTO_START
    # Allow the service to interact with the desktop.
    wrapper.ntservice.interactive=false
    Thanks & Regards,
    Mark

    Hello Kumar,
    The following should be the recommended parameters for your case. Always take a backup of initSID.ora and spfileSID.ora file before making the changes.
    fixcontrol Bug fix control parameter
    *._fix_control='5705630:ON','5765456:3','6221403:ON','6329318:ON','6399597:ON','6430500:ON','6440977:ON','6626018:ON','6670551:ON','6972291:ON','7325597:ON','7692248:ON','7891471:ON'
    max_dump_file_size = 20000
    optimizer_index_caching Adjust the usage of nested loops 0
    optimizer_index_caching (do not set)
    optimizer_index_cost_adj Percentage of the calculated index costs 100
    optimizer_index_cost_adj = 20
    parallel_max_servers=20
    parallel_threads_per_cpu = 1
    shared_pool_reserved_size
    CPUs   Shared_Pool_Size  
       4              500M                
       6                1G                   
      10                1G                
      32                2G                
      64                2G                
    128                3G      
    Resize db_cache depending on your needs. For your case, I would recommend at least 2GB of RAM for db_cache
    pushjoin_union_view
    pushjoin_union_view = false
    Set this as true if 6917874 fix is implemented.
    In addition Oracle processes should be calculated as follows
    Oracle Processes =
    { ABAP WP X 2  +
    J2ee Server Processes*MaxConnection  + Parallel_Max_Servers   + 40 }
    Hope I am clear.
    Thanks,
    Venkatesh Pydi.

  • Java newbie wants to set up a java mail server

    hi
    i want to set up a java mail server... but I don't really know how
    I've installed tomcat-apache and a mail server but I don't know how to implement the java part...
    here's an example that i refer to: http://java.sun.com/developer/technicalArticles/javaserverpages/emailapps/
    any step by step guide for beginner like me?
    thanx a lot
    bye

    http://james.apache.org/

  • Set role with Java JPA using NativeSQL

    Hi,
    using 10g setting roles with Java JPA and NativeSQL works fine. After the upgrade to 11g the same commands will not work.
    Ars ther any significant changes to set roles in 11g?
    Regards
    Siegwin

    Hi Siegwin,
    if you want to get help on a specific issue it would be helpful if you provide specific information. Despite the fact that this doesn't seem to be an XE specific question, you could provide additional information on your environment (JDK version, possibly container used, etc.; actual command issued, other things you may have done before to open/modify the session, etc.).
    I have one general hint anyway:
    Did you update your database drivers to support 11.2 as well? You probably use JDBC for your data source, so you should try the 11.2 JDBC drivers that fit to the JDK your application uses. I'm not sure if this already solves your problem, but it's highly recommended anyway as the 10.2 drivers will definetly come back with some trouble sooner or later when used against 11.2.
    -Udo

  • Set role with Java JPA and NativeSQL

    Hi,
    using 10g setting roles with Java JPA and NativeSQL works fine. After the upgrade to 11g the same commands will not work.
    Ars ther any significant changes to set roles in 11g?
    Regards
    Siegwin

    siegwin.port wrote:
    using 10g setting roles with Java JPA and NativeSQL works fine. After the upgrade to 11g the same commands will not work.
    Ars ther any significant changes to set roles in 11g?When I eval'd 11g, I did not notice any changes in setting my roles. I did notice a significant difference in Java. I cannot remember the JDK version change from 10g to 11g. We ended up settling back to 10g for other reasons.

  • How to set plug-in Java Runtime parameters on JRE setup command line

    Hi all:
    I need to install JRE and set the Java Runtime Parameters -Xmx
    by command line ..
    I mean I don't want enter Control panel and set this parameter manually in Java Runtime Parameters textBox..
    thanx.
    Best regards
    w.shiha

    Documentation for controlling the installation is sadly lacking in detail. This is the best I have seen for the Windows environment:
    http://java.com/en/download/help/silent_install.xml
    But, there are numerous other PROPERTY variables that are not discussed. Particularly annoying is the addition of yet another JavaUpdate item with the release of 1.5.0_05. If you can get more information, please post a link to it here.

  • How to set classpath from java application

    in my ian using Runtine.exec();
    here the code
    String cmd[]={"cmd.exe","/c","path=C:\\j2sdk1.4.2_03\\bin\\;"};
              Runtime runtime = Runtime.getRuntime();
              Process setPathProc = runtime.exec(cmd);
              Process proc = runtime.exec("javac "+path+"\\"+clsname+".java");
    it working when ian running the application class from command, but when iam creating a jar file and running it was not working,,
    any suggestion

    hi kaj,
    my problem is ,
    In my application i have to compile one java file and
    create class file for that java file, here before
    creating i have to set class path, am i right?
    so in my program only first i have to set class path,
    and later i have to compile, so, in my code i have
    mentioned the details about to set class path and
    compile the program, r u getting what iam telling,
    please help me, if u know anything,
    thanks

  • How to set classpath from java class ??

    I have tried to use System.setProperty("java.class.path", "my class path string ") to set classpath dynamically. But it is not working. How to set it dynamically from java class ?? Thanks , gary

    Look into the java.net.URLClassLoader. You can't set the classpath after the fact but you can specify URL's that will checked when you try to load a class with that loader.

  • Set credential using java embedding activity in SOA11g

    Hi,
    In SOA 10g in java embedding activity we used to set the creadentials like below
    *try {*
    getLocator().lookupProcess("bpelprocess_name").getDescriptor().getPartnerLinkBindings().getPartnerLinkBinding("partnerlink_name").setPropertyValue("basicHeaders",inputvar1);
    *}catch(Throwable ex) {*
    when we try to use the above expression in SOA11g, it doesn't work even after importing mandatory libraries. Pls suggest how to set the security credentials ln SOA11g using Java Embedding.
    Thanks,
    AB

    I can call the service from SOAP UI by providing username and password.Where do you provide username and password in SOAPUI?
    Service endpoint is like : https://myhost.com/ccx/service/hr...It is a SSL call so you need to configure the trust and identity keystore at Weblogic (SOA) server as well. make sure that you have imported the target server's certificate (along with it's CA if any) in your trust store of weblogic. You may refer-
    http://download.oracle.com/docs/cd/E17904_01/web.1111/e13707/identity_trust.htm#i1202182
    If it is two way SSL then the target server will also need your server's certificate in it's trust keystore.
    Regards,
    Anuj

Maybe you are looking for

  • One user can not map a network drive

                       Hi, A costumer of mine is trying to map a network drive for an existing user that has always had access to the NSS6000 Network Storage Device. This still works for all other users except this one. It looks like an authentication fa

  • CAN NOT OPEN EOS20D  FILE

    HAVE PHOTSHOP CS2. IN PAST NO PROBLEM OPENING CANON EOS20D FILE. PROBLEM WITH PC AND HAD TO REINSTAL VIA ADOBE WEBSITE. NOW CAN NOT OPEN FILE. DOES NOT RECOGNIZE

  • Can you connect 2 raids to 1 Xserve

    I have intel Xserve , with a raid connected, can I connect a second raid. All I want to do is store image files. So if I need a second Xserve would a g5 Xserve work fine for this. I have a small studio but looking to store personnal images and projec

  • Payroll PCR Remove duplicates from P0014

    Hello Experts, I have a requirement to delete duplicates from P0014 table in the payroll schema. The wages might occur due to the wpbp split but I have to discard all possible duplicates within the pay period. I'm not sure how to handle this in the P

  • Sleep/Awake Button not working

    My Sleep/Awake button has stopped functioning completely. Any suggestions?