Sign Up

Continue with Facebook
Continue with Google
Continue with Twitter
or use


Have an account? Sign In Now

Sign In

Continue with Facebook
Continue with Google
Continue with Twitter
or use

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

WhatisWhatis

WhatisWhatis Logo WhatisWhatis Logo

WhatisWhatis Navigation

  • Blog
  • Write For Us
  • About Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • All Questions
  • Polls
  • Followers
  • FAQs
  • Add A Group
  • Add A Post
  • Blog
  • Write For Us
  • About Us
Home/Website Development/Page 2

WhatisWhatis Latest Questions

Singasani Akshay
  • 1
Singasani Akshay
Asked: January 29, 2022In: Technology, Website Development

a namespace cannot directly contain members such as fields or methods

  • 1

Define Compiler Error Code CS0116. What does a namespace which cannot directly contain members such as fields or methods in c#? How can you fix it?

a namespace cannot directly contain members such as fields or methodsC#CS0116ErrorNamespacenamespace error
  1. Best Answer
    Singasani Akshay
    Added an answer on January 29, 2022 at 2:04 pm

    A namespace cannot directly contain members such as fields or methods: If you are new to coding, you may definitely come across a compiler error. If it shows the error code—CS0116, you have to get it fixed. Usually, such errors occur in C#. You will usually notice the error if a namespace cannot dirRead more

    A namespace cannot directly contain members such as fields or methods:

    If you are new to coding, you may definitely come across a compiler error. If it shows the error code—CS0116, you have to get it fixed. Usually, such errors occur in C#. You will usually notice the error if a namespace cannot directly contain members such as fields or methods.

    What Does This Error Signify?

    If you have recently started working on coding or C#, noticing such errors is common. You need to brush up coding concepts and just go through some introductory chapters to get familiar with namespace. 

    What does a namespace error or compiler error code-CS0116 look like?

    namespace DeveloperPublishNamespace

    {

        public int Field1;

        public class DeveloperPublish

        {

            public static void Main()

            {

     

            }

        }

    }

    Error: A namespace cannot directly contain members such as fields or methods

    Solution: Move the fields or methods into a class from namespace.

    Correct use of Namespace – An Example:

    namespace MyNameSpace

    {

       int i; <– THIS NEEDS TO BE INSIDE THE CLASS

     

       class MyClass

       {

          …

       }

    }

    Note: If you can’t recognize what’s “outside” the class, consider the addition/ deletion of misplaced or extra closing bracket(s) }.

    100% Correct Solution—Points to Remember:

    • Remove one of the closing curly braces from the three in a row.
    • Place a curly brace after the Swing Axe function. 
    • The use of a third closing curly brace starts post update function. 
    • SwingAxe Function is currently outside the class.
    • You have used invalid syntax and coding structure.

    Note: Next time, don’t declare a method or field under namespace. They should always be mentioned in the class.

    In Conclusion:

    Thus, namespace error can be easily detected and rectified using the correct way of placing brackets and curly braces. It’s one of the commonest errors that every user when they start working on C#. So, next time you notice a namespace cannot directly contain members such as fields or methods, you need not worry. Just make sure that your syntax is correct and you can easily get rid of the error.

    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  • 1 Answer
  • 63 Views
Singasani Akshay
  • 1
Singasani Akshay
Asked: January 28, 2022In: Technology, Website Development

What Is HTML?

  • 1

What is HTML? What are its features, format, advantages, and disadvantages? Explain how to use HTML correctly for creating a hyperlink?

HTMLHTML DefinitionHTML formatHTML MeaningHyperText Markup Languagewhat does html stand forWhat is HTMLwhat is html formatwhat is html used forwhat is the correct html for creating a hyperlinkWWW
  1. Best Answer
    Singasani Akshay
    Added an answer on January 28, 2022 at 5:27 am

    What is HTML or What Does HTML Stand for? HTML is the acronym of HyperText Markup Language. It’s a universal language and programming on which the entire structure of the internet and World Wide Web (WWW) depends. HTML helps users to write text, add comments, use tags and other attributes online. ItRead more

    What is HTML or What Does HTML Stand for?

    HTML is the acronym of HyperText Markup Language. It’s a universal language and programming on which the entire structure of the internet and World Wide Web (WWW) depends. HTML helps users to write text, add comments, use tags and other attributes online.

    It’s a specific type of programming code, which facilitates the creation of web pages online. All content you see online is in HTML format.

    Websites form the collection of HTML pages and are stored on a server online.

    When users type an URL on their browser’s address bar, including the prefix HTTP or HTTPS or WWW, in the beginning, it means they are requesting the server to open that specific web page for you.

    Know more:

    • Which functionality applies to html5 ads?

    What Is HTML and its Elements?

    Do we hope you can now easily explain what is HTML?

    Let’s take a look at its core elements.

    HyperText: It means text within the text. In simple terms, it refers to a technique to place a link on text. Whenever you click a linked text, it opens up a web page.

    Markup: Markup refers to a computer lingo, which provides a layout and easy formatting options for a text document. You can use it to add images, tables, infographics, and much more.

    Web Page or Online Content: All web pages and their content are usually processed through HTML.

    What is HTML used for?

    In this section, we will analyze what is HTML used for? And what are its uses?

    Web design and development: Web designers and developers have to excessively use HTML for creating web pages or adding an element to such pages. All hyperlinks, media files, images, and logos on websites are HTML-based elements.

    Web Page Navigations: How do you migrate from a website’s home page to its product page or contact us section? Well, it’s through the use of HTML codes.

    Mobile Apps: All mobile apps on Google play store or iOS stores are responsive or mobile-friendly versions of HTML-based websites. Using advanced technology, you can easily convert your web-based application to a mobile app.

    Read more:

    • Where should the Analytics tracking code be placed in the html of a webpage for data collection?

    Top Features of HTML:

    • It’s easy to learn and use.
    • It comes with plenty of formatting options.
    • It is fully compatible with Windows, Mac, Linux, and Ubuntu.
    • Integrate graphics, images, videos, and sound into your websites with HTML codes. 

    Advantages of HTML:

    • Get a lot of HTML community support for help.
    • It is fully free.
    • You can also use HTML with PHP, and Node.Js.

    Disadvantages of HTML:

    • It doesn’t support dynamic functionality.
    • You have to keep individual web pages for each HTML page.
    • Old browsers may have difficulty in using the latest HTML versions.

    What Is HTML format?

    Keep following things in mind while analyzing what is HTML format?

    Every HTML sentence consists of an opening tag, text, and closing tag. 

    The opening tag is represented by <p> and the closing tag is created using </p>.

    For example:

    This is an HTML file that can be written in HTML format as follows:

    <p>This is an HTML file</p>

    What is the correct HTML for creating a hyperlink?

    The correct HTML for creating a hyperlink using anchor text or keyword.

    This is an HTML file:

    <p>This is an <strong>HTML</strong> file</p>

    Note: Simply mention strong before the anchor keyword/ text and close it with </strong>. There should be no spaces after the anchor text.

    How to create headings in HTML?

    <h1>Main title</h1>

    <h2>Top level heading</h2>

    <h3>Subheading</h3>

    <h4>Sub-subheading</h4>

    In Conclusion:

    The credit for inventing HTML goes to Tim Berners-Lee. He was a contractor at CERN in the 1980s and conceptualized the concept of HTML for the first time to his associates and team members.

    Ever since its inception, HTML has gone through rapid changes and transformations. Now, we have HTML Versions 1.0 to 5.0.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  • 1 Answer
  • 47 Views
Editor
  • 1
Editor
Asked: January 26, 2022In: Technology, Website Development

What Is A Class in Java?

  • 1

What is a class in Java? What are the types of classes in Java? Explain how to create a class in Java and other salient points?

ClassClass in JavaClass in Java DefinitionDefinitionExample of Class in Javahow to create class in javaJavatypes of classesVariableWhat Is A Class in Java
  1. Best Answer
    Singasani Akshay
    Added an answer on January 26, 2022 at 3:25 pm

    What is a class in java? Class in Java refers to a specialized programming template, which is used to make new objects and define their data types and methods. You can also call it a blueprint, which facilitates the creation of other individual objects.   A class in Java can be attributed to a logicRead more

    What is a class in java?

    Class in Java refers to a specialized programming template, which is used to make new objects and define their data types and methods. You can also call it a blueprint, which facilitates the creation of other individual objects.  

    A class in Java can be attributed to a logical template, which helps to create objects with similar methods. All objects within the class also carry the same characteristics.  

    Rules You Must Follow While Creating Class in Java:

    • A class may be final or abstract. 
    • The components of a class are: class keyword and an identifier
    • You can indicate variables and methods within a Java class using curly braces. 

    Example of a class in Java

    Take for instance; Dogs. 

    A specific dog, like a Pomeranian, comes under the ‘object’ of the dogs. All dogs will share some similar features such as having a tail, white in colour, and many more.   

    Now once you create a class — “Dog.” You can’t go on to create a cricket match from it. Because when it comes to cricket matches, you need many more elements, including players, team name, venue name etc.  

    You can use Java constructors to initialize a new object in your Java class. You need to have at least a constructor—a default one by Java compiler or the one that you create. 

    Now that you have understood what is a class in java, let’s take a look at the types of classes in Java.

    What are the types of classes in Java?

    Local Variables:

    It often refers to temporary variables. They are often initialized and are available for garbage collection after the completion of the process.  

    Instance Variables:

    These are variables that are intrinsic to the object and can be easily entered into using any Java constructor, block or Java method.  

    Class Variables:

    Class variables are also called static variables in computer programming parlance. They also work like instance variables but they get created when the program starts and ends when it ends. 

    How to create a class in java?

    Now, we will look into the process of how to create a class in Java. 

    Here you have to use two keywords: class and the type that you want to define: 

    Main.java

    Create a class named “Main” with a variable x:

    public class Main {

      int x = 5;

    }

    Bonus Read: Class in Java 

    Every time you declare a class, use the class keyword. A class must contain data and a method to execute the command. The data within a class are called instance variables while the code that is executed is called methods.  

    In Conclusion: 

    Creating a class in Java is easy. You just have to make sure that you use “Class” for every class that you wish to create on Java. You can use this article for help.

    We hope you have now clearly understood the meaning of class in Java. For any additional queries or information on Java, please send in your comments. We will try to help you as much as possible.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  • 1 Answer
  • 47 Views
aprabha2626
  • 0
aprabha2626
Asked: January 26, 2022In: Technology, Website Development

What Is A Constructor in Java?

  • 0

What is a constructor in Java? Explain its process and features. Define Java constructor overloading. How is the Java constructor different from the Java method?

ConstructorConstructor in Javaconstructor overloading in javaDifference between Java Method and Java ConstructorFeatures of Constructors in Javahow to make a constructor in javaJavaJava MethodTypes of Java ConstructorsWhat Is A Constructor in Java
  1. Best Answer
    Singasani Akshay
    Added an answer on January 26, 2022 at 2:39 pm

    What is a constructor in Java? Many students want to know what is a constructor in Java. You will come across plenty of information online. However, if you wish to understand Java constructor in a simple and lucid language, you’ve come to the right place. We’ve made Java simpler for you to understanRead more

    What is a constructor in Java?

    Many students want to know what is a constructor in Java. You will come across plenty of information online. However, if you wish to understand Java constructor in a simple and lucid language, you’ve come to the right place. We’ve made Java simpler for you to understand, comprehend and even use practically on the computer. 

    A Java constructor refers to a series of codes, which is essential to specify the state of objects in the class. It helps in executing instance variables in that class. The only use of java constructor is to specify a particular task to data fields in the class. It can perform any action but it’s primarily responsible for managing or defining class in instance variables. 

    Types of Java Constructors

    • No-Arg Constructor or No Argument Constructor: You can’t include any argument in it. 
    • Default Constructor: You can create default Java constructor using Java compiler. It may or not accept arguments depending upon your purpose and requirement. 
    • Parameterized constructor: It must and always accepts arguments. 

    Features of Constructors in Java

    • The name of the constructor has to be defined and the same as the name of the class. 
    • The constructor must not return any value. 
    • If you don’t define a constructor in Java, the Java compiler will automatically assign standard values for all variables in the class. 

    How to make a constructor in Java?

    If you wish to make a default constructor in Java, use the following syntax coding: 

    Syntax of default constructor:

    <class_name>(){} 

    Rules and Essential Points

    • A Constructor name is always = class name.
    • A constructor shouldn’t be commanded to return type.
    • A Java Constructor can never be final, static, and abstract. 

    The Utility of Java Constructor

    • To set up a default value for each of the instance variables.
    • It’s important for initializing objects of a class.
    • It is useful to distribute appropriate memory to each object within the class.
    • You can execute the same code in the constructor. Mention it inside the constructor.

    Constructor Overloading in Java—Meaning and Significance

    In its simple terms, a Java constructor does actually refer to a ‘without return-type’ method. But it can also be overloaded to imitate a normal Java method. 

    Under constructor overloading in Java, multiple overloaders are used, each having a separate parameter list. Once executed, each constructor works and performs a different function. Compilers are used within the syntax to define their work and types. 

    Syntax of constructor overloading in java:

    class Main { 

      String language; 

      // constructor with no parameter

      Main() {

    this.language = “Java”;

      } 

      // constructor with a single parameter

      Main(String language) {

    this.language = language;

      } 

      public void getName() {

    System.out.println(“Programming Langauage: ” + this.language);

      } 

      public static void main(String[] args) { 

    // call constructor with no parameter

    Main obj1 = new Main(); 

    // call constructor with a single parameter

    Main obj2 = new Main(“Python”); 

    obj1.getName();

    obj2.getName();

      }

    }

    What is the Difference between Java Method and Java Constructor?

    Primarily, Java method always has a return type but a constructor doesn’t. Java method may or may not have the same name as the class, but the name of a constructor must be the same as its class and finally, Java method reflects how an object works, but a constructor just initialises the object. 

    In Conclusion:

    Constructor in Java is a significant topic. It holds the key to mastering the Java language and performing various functions on it. Java constructor in many cases works exactly the same as a normal Java method. If you start using Java constructor regularly for your programming or Java projects, you will easily understand everything about it. 

    Always remember that in many cases, Java method and Java constructor work similarly; however, they are not completely same all the time.

    See less
    • 0
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  • 1 Answer
  • 43 Views
Singasani Akshay
  • 0
Singasani Akshay
Asked: January 26, 2022In: Technology, Website Development

What Is C# Delegate?

  • 0

What is delegate in c#? Can you mention all the essential features, examples, and relevant points? What Is the Process Of Assigning Delegates?

C SharpC#C# Delegatec# delegate exampleDefinitionDelegatedelegate in C# DefinitionWhat Is C# Delegatewhat is delegate in c#
  1. Best Answer
    Singasani Akshay
    Added an answer on January 26, 2022 at 2:25 pm

    What is C# Delegate? C# Delegate refers to methods with a certain parameter list to define a method signature. You can use a delegate to associate it with any method and a compatible signature type. Users and developers can invoke the method using delegate instances.  You can process delegates to usRead more

    What is C# Delegate?

    C# Delegate refers to methods with a certain parameter list to define a method signature. You can use a delegate to associate it with any method and a compatible signature type. Users and developers can invoke the method using delegate instances. 

    You can process delegates to use smoothen methods as arguments or other methods. All event handlers are triggered using a custom method like a window control. The method used in the process may be the instance method or static method. 

    Using delegate c#, you can modify calls programmatically or even include a code into existing classes. The signature of a method usually never returns a value. However, in delegates, the signature always comes with a return value. 

    In the programming language you can compare a couple of objects in your app. And you can opt for a delegate method for its algorithm through a sort algorithm. 

    What Is the Process Of Assigning Delegates? 

    When you are working on c# delegate, you have to follow all its processes and methods carefully. 

    Step 1: Declaring a Delegate

    This is the primary step. You can declare your delegate by using a keyword and signature. 

    Use the following syntax to declare your delegate: 

    [access modifier] delegate [return type] [delegate name]([parameters]) 

    Step 2: Setting up a Target Method 

    When your step-1 is cleared, you have to set your new target method. In computer programming parlance, it’s also called lambda expression. Just insert an object of the delegate using the appropriate keyword and a passing method with a signature that matches with the signature originally created in step-1. 

    Alternatively, you can create a target method without creating a delegate object. 

    Take for instance; MyDelegate_del=MethodA 

    Step 3: Invoke a Delegate (Optional) 

    It can be further modified or invoked using the () operator symbols. 

    For Example: 

    del.Invoke(“Your Name”); 

    // or 

    del(“Your Name!”); 

    Multicast Delegate: Everything That You Should Know

    Many people ask what is delegate in c#? While we have explained all vital points to it in the above sections, now we’ll look into its vital topic: Multicast Delegate. 

    In simple terms, the multicast delegate is a process of delegating a task through multiple methods. You can use + or += operator to include a new function. Contrarily, if you use – and -=, the operator will remove that function. 

    Generic Delegate:

    Generic Delegate is another crucial C# Delegate Example, which you shouldn’t miss out. Under this process, you have to use a generic type of parameters or return type. While setting targets, the use of generic types must be specified or else your programming may go wrong. 

    In Conclusion:

    C# Delegate is always a tricky and lengthy subject. It might be easy for a programmer to understand all the nuances of Delegates but for a non-tech savvy person, it’s not so simple. 

    However, we have a programming hack for you. If you want a shortcut to a ‘delegate process’, just use the Action and Function command to complete necessary operations. 

    Always remember that function will return a certain value after its processing—while action represents a complete act and won’t return any value.

    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  • 1 Answer
  • 57 Views
1 2 3 … 14

Sidebar

Ask A Question
Add A Post
Create A New Group

Categories

Our Figures

  • Questions 1k
  • Answers 1k
  • Posts 1k
  • Comments 87
  • Best Answers 1k
  • Users 6k

Explore

  • Home
  • All Questions
  • Polls
  • Followers
  • FAQs
  • Add A Group
  • Add A Post

Footer

About Us

WhatisWhatis.com is trying to become one of the best question and answer platforms out there, which will help you establish your community and connect with other people.

Our Pages

  • About Us
  • Blog
  • Contact Us
  • Frequently Asked Questions (FAQs)
  • Privacy Policy
  • Questions
  • Write For Us To Submit A Guest Post Article on Technology, Education, Health, Apps, Gadgets, IoT, AI, Business, Digital Marketing and More!

Subscribe For Us

DMCA.com Protection Status

Our Feeds

Sitemap

RSS Feeds

Follow Us Here

Akshay
Online
Need help? Chat via Whatsapp

© 2019 - 2022 All rights reserved By WhatisWhatis.com

Need Help? Chat with us
Start a Conversation
Hi! Click one of our member below to chat on Whatsapp
The team typically replies in a few minutes.
Akshay
Need Any Help?