Skip to main content

Posts

File handling in java

  File handling implies how to read from and write to file in java.   • Java provides the basic I/O package for reading and writing streams.   • File class from the java.io package, allows do all input and output operations with different formats of files.   • In order to use the File class, you need to create an object of the class and specify the filename or directory name.  File class in java is particularly useful for retrieving information about files or directories fromdisk.   • File class is used to perform the following activities:   • Check if a file exists  • Before you can do anything with the file system or File class, you must obtain a File instance.  • Here is how that is done: Example: File file = new File("DriveLetter\\folderName\\fileName.txt"); Note: Objects of class File do not open files or provide any file-processing capabilities  • Createfile/folder • Read the length of a file...
Recent posts

Exception handling in java

WHAT IS    EXCEPTION HANDLING IN JAVA ?  Exception is an abnormal condition.(Dictionary Meaning)    In Java, an exception is an event that disrupts the normal flow of the program.    It is an object which is thrown at runtime.    In computing and computer programming, exception handling is the process of responding to the execution of a program (Wikipedia Definition). 3 occurrence of exceptions , anomalous or exceptional conditions requiring special processing during the   In general, an exception breaks the normal flow of execution and executes a pre-registered exception handler; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented.   Exception handling deals with these events to avoid the program or system crashing, and without this process, exceptions would disrupt the normal operation of a program.    Exceptions occur for num...

java guide for beginners

  Getting Started with Java: A Beginner’s Guide Welcome to the exciting world of programming! If you’re looking to dive into coding, Java is an excellent choice. It’s versatile, widely used, and has a strong community. Whether you're interested in web development, mobile apps, or game design, Java has something to offer. In this post, we’ll cover the basics to help you get started. Why  To Learn Java? Platform Independence : Java programs run on any device with the Java Virtual Machine (JVM). Write once, run anywhere! Object-Oriented : Java is based on the principles of object-oriented programming (OOP), making it easier to manage and organize code. Robust Community : With a large community of developers, finding resources, libraries, and support is simple. Setting Up Your Development Environment Before you start coding, you’ll need to set up your environment. Step 1: Install Java Development Kit (JDK) Go to the Oracle JDK download page . Choose the appropriate version for you...

creating layout on android studio

step 1 1 .open your android app 2.create a new project 3.select the empty activity and click next 4.fill the required details and finish. step2 open layout editor 1.in the project window, go to app>res>layouts 2.open the activity.xml file tep 3: Choose a Layout Type You can choose from several layout types depending on your needs: LinearLayout: Arranges children in a single row or column. RelativeLayout: Positions children relative to each other. ConstraintLayout: Allows flexible positioning using constraints. FrameLayout: Stacks children on top of each other. step 4 add views TextView ImageView Button step 5 add attributes example(TextView) android:text="hello world" android:textSize="34sp" android:textcolor="@android:color/black" etc.

CODING IN WORDS

 “Coding in words” is about breaking down programming concepts into simple, understandable terms. It’s a way to communicate the essence of coding without submerging in the syntax, making it fun and easier for beginners. Coding doesn’t have to be overwhelming.  we can make programming concepts accessible and engaging for all. Whether you’re teaching, learning, or collaborating, remember that clear communication is essential in the tech world. Let’s simplify coding together.